kevinohara80/dmc

New version of ADM-ZIP breaking metadata retrieve

Opened this issue · 0 comments

I upgraded dmc to the latest version this week, and noticed that the retrieve command was failing with an error "ENOENT No such file or directory: [userfolder].dmc.tmp\unpackaged\package.xml".

Investigation showed that rather than having an "Unpackaged" folder in the .tmp area, there is one file called "unpackaged_package.xml". The contents of this file seems to be one of the apex classes that was being retrieved.

Another computer using the same DMC version was still retrieving correctly. I noticed that the adm-zip version was different on the two machines. Adm-zip 0.4.7 was working, v0.4.9 was not.

I modified the package.json on the broken machine to specify 0.4.7 as a dependency version and ran npm i in the dmc folder. NPM installed the older version, and DMC immediately is able to retrieve again.

The error was occurring in retrieve.js when trying to use fs.readFileAsync. However, the source of problem is when zip.extractAllToAsync() extracts the zip contents improperly.

Edit: This is an issue on their github: cthackers/adm-zip#220