cross-zip-cli
cross-zip-cli copied to clipboard
When zipping a directory, the zip file is always created in its parent directory regardless of the desired path
Sample package.json:
{
"name": "zip-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "cross-zip ./parent/child/grandchild output.zip"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cross-zip-cli": "^1.0.0"
}
}
Make a nested directory structure:
mkdir -p parent/child/grandchild
echo "foo" > parent/child/grandchild/data.txt
Run the script:
$ npm run test
> [email protected] test /Users/sepiaj/ws/zip-test
> cross-zip ./parent/child/grandchild ./output.zip
Expected result: The zip file appears in the CWD (or in this case, the root of the project), as a sibling to package.json.
Actual result: The zip file shows up in parent/child/.
Thanks for reporting. IRC... this may be a platform limitation. You'll want to dig in https://github.com/feross/cross-zip to find out more.
@jsepia, what platform are you running on? Placing the output file in a separate single subdirectory is working for me on Windows 10, e.g.
cross-zip source target/foobar.zip