node-zip icon indicating copy to clipboard operation
node-zip copied to clipboard

Is file wildcard supported by command line?

Open fuweichin opened this issue 7 years ago • 1 comments

I need to compress contents of a directory into a zip file, so I tried

nodezip -c build.zip build/*

but a error occurred which says

Error: file build/* not found.

fuweichin avatar May 13 '17 02:05 fuweichin

I wasn't able to reproduce, all of these worked:

on my side:

sh -c "./node_modules/.bin/nodezip -c artifacts/dist.zip dist/*"
Creating artifacts/dist.zip...
  Adding file dist/hello
  Adding folder dist/test
  Adding file dist/test/temp
Deflating...
Done.
bash -c "./node_modules/.bin/nodezip -c artifacts/dist.zip dist/*"
Creating artifacts/dist.zip...
  Adding file dist/hello
  Adding folder dist/test
  Adding file dist/test/temp
Deflating...
Done.
zsh -c "./node_modules/.bin/nodezip -c artifacts/dist.zip dist/*"
Creating artifacts/dist.zip...
  Adding file dist/hello
  Adding folder dist/test
  Adding file dist/test/temp
Deflating...
Done.

but I personally use it this way:

./node_modules/.bin/nodezip -c artifacts/dist.zip dist

Creating artifacts/dist.zip...
  Adding folder dist
  Adding file dist/hello
  Adding folder dist/test
  Adding file dist/test/temp
Deflating...
Done.

The difference is that when extracting the file, using without wildcard will create the folder (count the number of Adding lines to see the difference)

Command line usage should definitely be documented somwhere

GabLeRoux avatar May 15 '18 14:05 GabLeRoux