Skip to content

Instantly share code, notes, and snippets.

@kassane
Forked from karbassi/Instructions.md
Last active October 1, 2023 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kassane/926db11bd96d25088e21f13d73c4a6af to your computer and use it in GitHub Desktop.
Save kassane/926db11bd96d25088e21f13d73c4a6af to your computer and use it in GitHub Desktop.
Create a ZIP file from an SVN url

Installing

  • Need install svn application!!!
  • on svn-zip get gist raw-url
  • Download svn-zip into local folder. For example: curl [raw-url] > svn-zip
  • add run privilege with chmod +x snv-zip or execute bash svn-zip SVN_URL ZIP_FILE_NAME

Usage

In your terminal, use:

svn-zip SVN_URL ZIP_FILE_NAME

The ZIP_FILE_NAME does not need a .zip ending.

#!/bin/bash
if [ $# -ne 2 ] ; then
echo "Usage: "`basename "$0"` "SVN_URL ZIP_NAME" >&2
exit 1
fi
SVN_URL=$1
DIR_NAME=$2
svn export $SVN_URL $DIR_NAME && zip -rq ${DIR_NAME}.zip $DIR_NAME && rm -rf $DIR_NAME
echo "Successfully created ${DIR_NAME}.zip from ${SVN_URL}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment