I am working on a game (Quake 3) and use an SVN repository to store the code tree. The tree also contains game data (textures, models, etc). This must be put into a PK3 archive (a standard ZIP archive with a different extension). I use the ZIP utility in a simple script to create the PK3 archive.
My problem is that the game data is also versioned, and the folder containing the data is cluttered with all those '.svn' subfolders. Of course, ZIP includes these subfolders into the archive. They are not needed by the game. Is there a simple way to tell ZIP to exclude all '.svn' subfolders from the archive?
The find command returns a list of all the subfolders matching “. svn”, and this is then piped to the rm command to recursively delete the directory. Running rm using the full path will remove the confirmation prompt, and the “rf” arguments will recursively delete any folder contents.
Exclude Multiple Files/Directories from Zip Archive You can define -x multiple times in a single zip command to exclude multiple files and directories from zip archive.
In particular, each directory in your working copy contains a subdirectory named . svn, also known as the working copy's administrative directory. The files in each administrative directory help Subversion recognize which files contain unpublished changes, and which files are out of date with respect to others' work.
Right click on the project, go to Team->disconnect. It will open a popup where you select the first option: 'Also delete the SVN meta-information from file system. ' This will remove all the SVN folders automatically along with svn property files that you might forget sometimes while removing .
zip -r output.zip inputdir -x "**/.svn**"
this will exclude everything starting with ".svn" in any subfolder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With