I recently upgraded from 0.4.10 to the latest (0.4.14) and found that extractEntryTo was no longer preserving subdirectories in my zip files. Instead it was unzipping everything into a flat folder.
These zip files contain a single top level entry which is a folder that contains the code. I want to unzip the contents of that folder into another folder. To do so I am doing this:
const AdmZip = require("adm-zip");
const zip = new AdmZip("/path/to/my/file.zip");
zip.extractEntryTo(zip.getEntries()[0], "myNewDirectory", false, true);
I expect myNewDirectory to hold the Github Repo code just as it looks in GitHub, but instead it contains no folders and every file is sitting flat inside myNewDirectory. This worked in 0.4.10 however when I tried rolling back versions I found it was broken in every version after 0.4.10.
Thanks for taking a look at this issue. Let me know if you need any more details.
Hi,
I recently upgraded from 0.4.10 to the latest (0.4.14) and found that
extractEntryTo
was no longer preserving subdirectories in my zip files. Instead it was unzipping everything into a flat folder.To demonstrate this issue you can download any Github repository zip such as: https://github.com/cthackers/adm-zip/archive/master.zip
These zip files contain a single top level entry which is a folder that contains the code. I want to unzip the contents of that folder into another folder. To do so I am doing this:
I expect
myNewDirectory
to hold the Github Repo code just as it looks in GitHub, but instead it contains no folders and every file is sitting flat insidemyNewDirectory
. This worked in0.4.10
however when I tried rolling back versions I found it was broken in every version after0.4.10
.Thanks for taking a look at this issue. Let me know if you need any more details.