24 lines
432 B
Bash
Executable file
24 lines
432 B
Bash
Executable file
#!/bin/sh
|
|
# usage: make-release.sh release
|
|
# Make a tarball of software excluding git history and leftover files
|
|
|
|
[ -z "$1" ] && printf 'usage: make-release.sh version\n' && exit 1
|
|
|
|
name="$(basename "$(pwd)")"
|
|
cd ../
|
|
cp -R "$name" "$1"
|
|
cd "$1"/
|
|
rm -fr .git .build.yml .builds
|
|
|
|
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"/
|