Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot zip files in subdirectories #84

Open
sa-spag opened this issue Feb 14, 2019 · 12 comments
Open

Cannot zip files in subdirectories #84

sa-spag opened this issue Feb 14, 2019 · 12 comments

Comments

@sa-spag
Copy link

sa-spag commented Feb 14, 2019

Hey there 😃

Calling ziputil.ZipDir("path/to/file", "path/to/zip", false) produces the /usr/bin/zip -rTy path/to/zip file command which ultimately fails with zip I/O error: No such file or directory as file does not exist but path/to/file does.
Indeed, this happens:

zipTarget := filepath.Base(sourceDirPth)

Before opening a pull request I wanted to know if there was any reason behind this implementation.
Thanks!

@fehersanyi-bitrise
Copy link

Hello @sa-spag

is this a custom script, or the Create ZIP step?

@sa-spag
Copy link
Author

sa-spag commented Feb 14, 2019

I can reproduce the issue with the Create ZIP step.

@fehersanyi-bitrise
Copy link

Could you please send me a build's url where this issue happens, so I can check out the full logs to it?

@sa-spag
Copy link
Author

sa-spag commented Feb 14, 2019

Here it is. Notice the:

config:
- SourcePath: path/to/file
- Destination: path/to/zip
Issue with compress: command: (/usr/bin/zip "-rTy" "path/to/zip" "file") failed, output: zip I/O error: No such file or directory
zip error: Could not create output file (path/to/zip), error: exit status 15

@fehersanyi-bitrise
Copy link

fehersanyi-bitrise commented Feb 15, 2019

could it be that the correct path would be Users/vagrant/git/fastlane/test_output/BlaBlaCar.test_result/ ?

hmm that is the same that you set 🤔 I would try it to be sure

@sa-spag
Copy link
Author

sa-spag commented Feb 15, 2019

As I expected:

Error: failed to parse config:
- SourcePath: /Users/vagrant/git/fastlane/test_output/BlaBlaCar.test_result/: file does not exist

Again I'm pretty sure my initial problem is that filepath.Base is called but I want to make sure it's indeed not the intended behavior.

@fehersanyi-bitrise
Copy link

could you add and run a script step with:

#!/bin/bash
set -e
set -x
/usr/bin/zip "-rTy" "/Users/vagrant/git/fastlane/test_output/BlaBlaCar.test_result.zip" "BlaBlaCar.test_result"

@sa-spag
Copy link
Author

sa-spag commented Feb 18, 2019

"BlaBlaCar.test_result" does not exist (but fastlane/test_output/BlaBlaCar.test_result does), the previous snippet will fail. FYI I already implemented a workaround using a script step:

- script:
    title: Compress test results bundle
    is_always_run: true
    inputs:
    - content: |-
        #!/usr/bin/env bash
        set -ex
        cd fastlane/test_output
        zip -qrTy BlaBlaCar.test_result.zip BlaBlaCar.test_result

@fehersanyi-bitrise
Copy link

fehersanyi-bitrise commented Feb 18, 2019

I'm glad you found a solution!
and I realised that if you give it the long path, then the second argument needs the same path to it as well like
/usr/bin/zip "-rTy" "/Users/vagrant/git/fastlane/test_output/BlaBlaCar.test_result.zip" "/Users/vagrant/git/fastlane/test_output/BlaBlaCar.test_result"

@usmonster
Copy link

Bump—is this issue still on the radar? The workaround is pretty inconvenient for something that should work out of the box. Thanks!

@tdesert
Copy link

tdesert commented Mar 11, 2020

Hello @fehersanyi-bitrise, is this issue still considered?

@adborbas
Copy link
Contributor

adborbas commented Sep 8, 2020

Hi @tdesert, Could you please send a build URL where the issue is reproducible? My guess is that the issue happens when the destination directory does not exist, but this should be validated. Thanks

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

No branches or pull requests

5 participants