Last active
August 29, 2015 14:04
-
-
Save rheinardkorf/9d49e293babffdc4d00e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A script I use daily to quickly zip up a git repo. | |
# Note you will need: https://github.com/Kentzo/git-archive-all | |
# | |
# Adaptation of: https://gist.github.com/uglyrobot/e872d1a9efc122b6bae2 | |
if [[ $# -eq 0 ]] ; then | |
echo "Please enter a version number:" | |
read VERSION | |
else | |
VERSION=$1 | |
fi | |
if [[ $2 -eq 0 ]] ; then | |
THEPATH="../" | |
else | |
THEPATH=$2 | |
fi | |
if [[ -z "$VERSION" ]] ; then | |
echo "Sorry, I need a version number!" | |
exit 0 | |
fi | |
NAME=${PWD##*/} | |
echo $THEPATH$NAME-$VERSION | |
git-archive-all --force-submodules --prefix $NAME/ $THEPATH$NAME-$VERSION.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added this as an alias to my shell and call it from inside the git repo.