make-release.sh: init script

This commit is contained in:
Jeremy Baxter 2024-07-14 17:19:06 +12:00
parent 3cf35ad1d0
commit d83675d3a0

22
scripts/make-release.sh Executable file
View file

@ -0,0 +1,22 @@
#!/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"/