Couldn't create archive on top level
pingwin4ik opened this issue · 5 comments
cd build/ && bestzip ../build.zip *
not working this feature:
(This will not include the build/ folder, it's contents will be top-level.)
version 2.1.7
Thank you!
You're not at the top level though. You changed directory to be the build directory.
If you want the build directory to be included, wouldn't you do bestzip ./build/build.zip *
?
@pingwin4ik what OS are you on, and what tool are you using to extract the .zip files?
Some extraction tools automatically add a grouping folder when there are multiple top-level files. The one built into macOS does, for example. However if you use a tool to inspect the .zip without extracting it such as https://extract.me/ it should show things as expected.
For example, I made these two .zip files from the test/ directory:
npx bestzip fixtures-with-folder.zip fixtures/*
created fixtures-with-folder.zip
cd fixtures/; npx bestzip ../fixtures-without-folder.zip *
created fixtures-without-folder.zip
On my macbook, fixtures-with-folder.zip
extracts to a folder named fixtures/
as expected, but fixtures-without-folder.zip
extracts to a folder named fixtures-without-folder/
- this was not part of the .zip file, the mac Archive Utility created that folder based on the name of the .zip file.
I also tested the above with --force=node
and got identical results.
You're not at the top level though. You changed directory to be the build directory.
If you want the build directory to be included, wouldn't you do
bestzip ./build/build.zip *
?
Thank you for response ;=)
We try to run in azure pipeline and we want archive all files in folder "build" without folder
we run next command: "cd build/ && bestzip ../archive.zip *"
P.S. run in Ubuntu 16 04 as runner on Azure and then publish to bucket
The problem is that when you use "*" it doesn't zip .dot files like .htaccess.
I want to zip for example the dist folder but in the archive I dont want a dist folder , I need to be top level so:
I do: cd dist && bestzip ../dist.zip && cd ../
it gives an error
when I do: "cd dist && bestzip ../dist.zip ./ && cd ../" it's all got except no htaccess file
I think that later version should include the dotfiles.. what happens with a native zip command?
Alternatively, does it work if you include them explicitly? cd dist && bestzip ../dist.zip ./ .htaccess && cd ../