Avoid unwanted path in Zip file
- by jerwood
I'm making a shell script to package some files. I'm zipping a directory like this:
zip -r /Users/me/development/something/out.zip /Users/me/development/something/folder/
The problem is that the resultant out.zip archive has the entire file path in it. That is, when unzipped, it will have the whole "/Users/me/development/anotherthing/" path in it. Is it possible to avoid these deep paths when putting a directory into an archive?
When I run zip from inside the target directory, I don't have this problem.
zip -r out.zip ./folder/
In this case, I don't get all the junk. However, the script in question will be called from wherever.
FWIW, I'm using bash on Mac OS X 10.6.