twolfson / grunt-zip

Zip and unzip files via a grunt plugin
MIT License
87 stars 19 forks source link

Unable to expand DEFLATE grunt-zipped file #25

Closed antoi closed 10 years ago

antoi commented 10 years ago

I'm MAC OS X 10.9.3 User. When I grunt-zip my big WebApp (20M) by DEFLATE option, the generated zip file can not be uncompressed, with a error: Unable to expand "upload.zip" into "dist". (Error 2 - No such file or directory.). When use NON-DEFLATE setting, The grunt-zipped file can be uncompressed. The option settings are:

        zip: {
            dist: {
                cwd: "dist/www/",
                src: "dist/www/**/*",
                dest: "dist/upload.zip",
                compression: "DEFLATE"
            }
        }

My folder structure is below where resources is library folder: screen shot 2014-06-10 at 4 58 07 pm

When the app is big with library (20M), the DEFLATE grunt-zipped file can't be uncompressed. When it's small without library, everything works normally. You can reproduce the error by the simple example above. The library can be downloaded by [https://openui5.hana.ondemand.com/downloads/openui5-runtime-1.20.6.zip]

I hope my issue can help others, while actually I have to zip /www folder manually.

twolfson commented 10 years ago

Taking a look for triage now.

twolfson commented 10 years ago

It's unclear which file you are referring to on http://sap.github.io/openui5/download.html

Can you provide a direct link?

antoi commented 10 years ago

@twolfson Thank you for your attention. When I test, I downloaded this one as /resources : https://openui5.hana.ondemand.com/downloads/openui5-runtime-1.20.6.zip

twolfson commented 10 years ago

Alright, cool. I will take a look at this by the end of the weekend.

twolfson commented 10 years ago

Looking to reproduce issue now

twolfson commented 10 years ago

I have successfully reproduced on Linux via https://gist.github.com/twolfson/23f7de9ca9ead47dc5f8

For what it is worth, it looks like not using DEFLATE works fine.

I am going to continue triaging the issue.

twolfson commented 10 years ago

Alright, I am going to say this is our zip library since it works without DEFLATE. We are on a 2 year old version of node-zip which now has been more/less replaced by jzzip. I will attempt to upgrade to the latest version by the end of this weekend.

https://github.com/daraosn/node-zip

https://github.com/Stuk/jszip

twolfson commented 10 years ago

Trying out upgrade now

twolfson commented 10 years ago

I wound up rewriting the test suite since it was a pain to run a test standalone. After doing so, I quickly debugged the upgrade issue.

I have upgraded to JSZip@2.2.2 in grunt-zip@0.15.0. This seems to have fixed the reported issue. Thanks for the bug report!