How can I create a zip file but starting from particular subdirectory? #3
-
Not really an issue, but maybe anyone can help me to figure out what's wrong... I have a repo with some files and a subdirectory for an AWS lambda function. I'd like to create a zip with files from \lambda\awszone\ and its subfolders, but the zip should not contain the \lambda\awszone\ part of the path, that is: index.js should be on the root of the generated .zip file. I've tried using your examples with the -r recursive option, also tried with -j (error for file with the same name) and -D (didn't change anything)... All my test create zip file containing the full path (\lambda\awszone). Can anybody please give me some suggestions? Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
I can't test it right now, however I believe if you change the cd /lambda/awszone && zip -r output.zip * then it should work. Please note, this means the destination of the zip will probably be in the |
Beta Was this translation helpful? Give feedback.
-
It looks as "cd" command is not present in the docker instance. The error is:
I tried args |
Beta Was this translation helpful? Give feedback.
-
I'm gonna have to work on adding this to the project. Perhaps for now you could (in a separate step) copy the files you need to the working directory and then zip them from there. Alternatively you could install zip and cd in using the run commands. |
Beta Was this translation helpful? Give feedback.
-
Hi Monte, |
Beta Was this translation helpful? Give feedback.
-
@ranganapeiris unfortunately I am pretty occupied at the moment but I will get working on a fix asap |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, is this resolved ? |
Beta Was this translation helpful? Give feedback.
-
An update is in the works and v2 should be ready soon. I apologise for the amount of time it's taking. This year has given me a limited amount of time to work on this project. |
Beta Was this translation helpful? Give feedback.
-
cd is actually a shell buildin and not a command and that is why it fails with cd
|
Beta Was this translation helpful? Give feedback.
-
Confirmed this "workaround" and works perfectly. Thanks! |
Beta Was this translation helpful? Give feedback.
-
You can also use multiple steps in the Github job workflow. Layers from the previous step are available in later steps.
|
Beta Was this translation helpful? Give feedback.
-
This seems like a good clean solution to me. For now, I would say this is the way to go. I have added this example to the README. Thanks @sdemjanenko! |
Beta Was this translation helpful? Give feedback.
You can also use multiple steps in the Github job workflow. Layers from the previous step are available in later steps.