Add simple tarball / release script
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
This commit is contained in:
parent
211dd91db8
commit
088799e2e7
30
utils/gen-tar
Executable file
30
utils/gen-tar
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! [ -d .git ]; then
|
||||
echo "Not a git archive"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
echo Creating a tarball with version $1
|
||||
fi
|
||||
|
||||
_owd=`pwd`
|
||||
_cwd=`basename $_owd`
|
||||
_branch=`git branch | grep "^\*" | awk '{print $2}'`
|
||||
_archive=$_cwd-$_branch-`date +%Y-%m-%d`.tar.gz
|
||||
|
||||
TMPDIR=$(mktemp -d /tmp/$_cwd-XXXXXX)
|
||||
|
||||
cd ..
|
||||
cp -a $_cwd $TMPDIR
|
||||
cd $TMPDIR
|
||||
if [ -n "$1" ]; then
|
||||
mv $_cwd $_cwd-$1
|
||||
_cwd="$_cwd-$1"
|
||||
_archive=$_cwd.tar.gz
|
||||
fi
|
||||
tar --exclude .git -czvf $_archive $_cwd
|
||||
cd $_owd
|
||||
cp $TMPDIR/$_archive .
|
||||
rm -rf $TMPDIR
|
Loading…
Reference in New Issue
Block a user