daraosn / node-zip

217 stars 38 forks source link

Is file wildcard supported by command line? #20

Open fuweichin opened 7 years ago

fuweichin commented 7 years ago

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.

GabLeRoux commented 6 years ago

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