max-mapper / extract-zip

Zip extraction written in pure JavaScript. Extracts a zip into a directory.
BSD 2-Clause "Simplified" License
391 stars 127 forks source link

Ensure the directory of the zip entry exists before running realpath #40

Closed MarshallOfSound closed 7 years ago

MarshallOfSound commented 7 years ago

realpath requires that the directory path it is attempting to resolve actually exists, so we need to create it before running the check as not all zip files create the directory before extracting a file into it.

This fixes the current issue with electron-prebuilt

/cc @malept @maxogden

Fixes #38.

malept commented 7 years ago

I don't suppose you can fix the tests? (And possibly add a test with a directory in it?)

MarshallOfSound commented 7 years ago

They pass on my machine, don't really have time to look at them 😢

Fork is open to contribs to push to though if someone wants to pick this up

malept commented 7 years ago

Fork is open to contribs to push to though if someone wants to pick this up

Done :smile:

HoWingYip commented 7 years ago

There was a workaround to set "extract-zip" to "=1.6.0", but I still get the same error when it's running "node install.js". I'm trying to install the Electron framework via npm 4.6.1. I have reinstalled Node.js and therefore npm. This workaround does not seem to work.

malept commented 7 years ago

Please be patient, I'm in the middle of releasing 1.6.5 with this fix.

HoWingYip commented 7 years ago

I am sorry.

HoWingYip commented 7 years ago

FIXED! Thank you so much @malept!

malept commented 7 years ago

Be sure to thank @MarshallOfSound too, he's the one who wrote the actual fix.

HoWingYip commented 7 years ago

Thanks, @MarshallOfSound!