twolfson / grunt-zip

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

Error when extracting zip file containing empty directories #21

Closed michael-lawrence closed 10 years ago

michael-lawrence commented 10 years ago

Getting an error when trying to unzip a zip file that contains empty directories. I get:

Warning: ENOENT, no such file or directory '/DESTINATION/App_Code/' Use --force to continue.

Aborted due to warnings.

Here is the zip file I'm using: http://our.umbraco.org/ReleaseDownload?id=100660

Any idea what may be causing this?

Thanks!

twolfson commented 10 years ago

Interesting, I will take a look at this by the end of the week.

michael-lawrence commented 10 years ago

Thanks!

twolfson commented 10 years ago

Taking a look at this now.

twolfson commented 10 years ago

Geez, this is one big zip o_o

twolfson commented 10 years ago

Alright, successfully reproduced. Now to write a regression test and patch it.

https://gist.github.com/twolfson/7905764

twolfson commented 10 years ago

Okie doke, this has been patched on bug/cannot.unzip.empty.dir. However, I am going to take a break before merging it to add in Travis CI.

twolfson commented 10 years ago

Alright, Travis CI is integrated. This patch has been released in 0.11.0.

Thanks for the nice bug catch and report!

michael-lawrence commented 10 years ago

Unfortunately I'm still getting the error after updating to 0.11.0. I'm running this on Mac OS X 10.9 if that makes any difference.

twolfson commented 10 years ago

Oh noes =(

Alright, I will re-open it.

twolfson commented 10 years ago

Okay, successfully reproduced on my work computer. On Linux, it was EISNOTDIR. I will continue to reproduce this at home (via SauceLabs Mac virtualization).

michael-lawrence commented 10 years ago

Thanks!

twolfson commented 10 years ago

Alright, pulling this up in Sauce Labs.

twolfson commented 10 years ago

Okay, patched for OSX on bug/unzip.empty.osx. However, Windows looks likes it needs some massaging

twolfson commented 10 years ago

Alright, I ditched the error catching logic and went for a simpler solution of sniffing the path for /. This seems to work on all platforms.

Released in 0.12.0.

michael-lawrence commented 10 years ago

Nice! It's working! :+1: