Created
September 10, 2012 12:15
-
-
Save SignpostMarv/3690604 to your computer and use it in GitHub Desktop.
Shell script for packaging up OpenSim builds (run from bin directory)
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
GITNAME="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')" | |
DIRNAME="${1-../..}/${GITNAME}" | |
TIMESTAMP="$(date +%Y-%m-%d_%H-%M-%S)" | |
FILENAME="opensim (${GITNAME}) ${TIMESTAMP}" | |
if [ -f ../../7za.exe ]; | |
then | |
echo "Using 7-zip" | |
../../7za.exe a "../../${FILENAME}.tar" ./* | |
../../7za.exe a -tgzip "../../${FILENAME}.tgz" "../../${FILENAME}.tar" -mx=9 -mfb=258 -mpass=15 | |
rm "../../${FILENAME}.tar" | |
else | |
echo "using tar" | |
tar --exclude=".*" -pvczf "../../${FILENAME}.tgz" * 1> /dev/null | |
fi; | |
mkdir -p "${DIRNAME}" | |
mv "../../${FILENAME}.tgz" "${DIRNAME}/${FILENAME}.tgz" | |
echo "${DIRNAME}/${FILENAME}.tgz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tweaked the dirname variable so the trailing slash does not need to be specified.