1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#!/bin/bash
which git >/dev/null
if [ $? != 0 ]; then
echo "Command git not found. Install git and try again."
exit 1
fi
set -o errexit
BUILD_DATE=`date +%Y%m%d`
MYDIR=`pwd`
TMPDIR=`mktemp -d`
echo "${TMPDIR}"
cd "${TMPDIR}"
git clone --recursive https://github.com/lancos/ponyprog.git
if [ ! -d ponyprog ]; then
echo "ponyprog dir not found!"
exit 1
fi
echo "Creating tar..."
tar cfz "${MYDIR}/ponyprog-${BUILD_DATE}.tar.gz" --exclude=.git --exclude=InpOutLib ponyprog
echo "Done."
echo "Creating zip..."
zip -q -l --exclude='*/.git*' -r "${MYDIR}/ponyprog-${BUILD_DATE}.zip" ponyprog
echo "Done."
cd ${MYDIR}
rm -rf "${TMPDIR}"
exit 0
|