garage/scripts/make-release.sh

22 lines
345 B
Bash
Executable file

#!/bin/sh
# usage: make-release.sh release
# Make a tarball of software excluding git history and leftover files
name="$(basename "$(pwd)")"
cd ../
cp -R "$name" "$1"
cd "$1"/
rm -fr .git
IFS="\n"
if [ -e .gitignore ]; then
for file in $(cat .gitignore); do
rm -fr "$file"
done
fi
cd ../
tar -czf "$1".tar.gz "$1"
rm -r "$1"
cd "$name"/