File: create_src_tar.sh

package info (click to toggle)
ponyprog 3.1.3%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,488 kB
  • sloc: cpp: 35,376; python: 981; sh: 565; makefile: 41; ansic: 38
file content (35 lines) | stat: -rwxr-xr-x 650 bytes parent folder | download | duplicates (4)
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