Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Couldn't create archive on top level #42

Open
pingwin4ik opened this issue Oct 9, 2020 · 5 comments
Open

Couldn't create archive on top level #42

pingwin4ik opened this issue Oct 9, 2020 · 5 comments

Comments

@pingwin4ik
Copy link

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!

@Lampei
Copy link
Collaborator

Lampei commented Oct 9, 2020

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 * ?

@nfriedly
Copy link
Owner

nfriedly commented Oct 9, 2020

@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:

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.

@pingwin4ik
Copy link
Author

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

nfriedly added a commit that referenced this issue Oct 9, 2020
@adeviss2
Copy link

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

@nfriedly
Copy link
Owner

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 ../

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants