1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 07:04:08 +00:00
zap/create-archive.sh
2023-05-01 06:19:22 +02:00

35 lines
993 B
Bash
Executable file

#!/usr/bin/env bash
tag=$1
override=$2
if [ "$tag" == "--override" ] ; then
override=$tag
tag=""
fi
if [ "$tag" == "" ] ; then
tag=$(git rev-parse --abbrev-ref HEAD)
echo "Warning: no tag provided, using: >> $tag <<"
fi
git archive --format=tar.gz -o ${tag}.tar.gz --prefix=zap-$tag/ HEAD
git diff --quiet
if [ $? -ne 0 ] ; then
if [ "$override" == "--override" ] ; then
./zig-out/bin/pkghash -g --tag=$tag --template=doc/release-template.md
else
echo "WARNING: GIT WORKING TREE IS DIRTY!"
echo "If you want to get zig hash anyway, run:"
echo "./zig-out/bin/pkghash -g"
echo "or, with full-blown release-notes:"
echo "./zig-out/bin/pkghash -g --tag=$tag --template=doc/release-template.md"
echo ""
echo "To skip this message and do the pkghash thing anyway, supply the"
echo "--override parameter"
fi
else
./zig-out/bin/pkghash -g --tag=$tag --template=doc/release-template.md
fi