Actually fix the tar deletion issue

This commit is contained in:
RichardG867 2021-11-17 18:45:20 -03:00
parent 09529eaf2f
commit 4e337a3f1f
2 changed files with 8 additions and 1 deletions

@ -172,20 +172,26 @@ then
# Clean local tree of gitignored files.
git clean -dfX
# Recreate output directory if it was removed by git clean.
[ ! -d "$cwd" ] && mkdir -p "$cwd"
# Save current HEAD commit to VERSION.
git log --stat -1 > VERSION || rm -f VERSION
# Archive source.
make_tar "$cwd/$tarball_name.tar"
rm -f "$tarball_name.tar*"
make_tar "$tarball_name.tar"
status=$?
# Check if the archival succeeded.
if [ $status -ne 0 ]
then
echo [!] Tarball creation failed with status [$status]
rm -f "$tarball_name.tar*"
exit 1
else
echo [-] Source tarball [$tarball_name] created successfully
mv "$tarball_name.tar*" "$cwd/"
[ -z "$package_name" ] && exit 0
fi
fi

1
.gitignore vendored

@ -30,6 +30,7 @@ Makefile
/archive_tmp
/static2dll.*
/VERSION
/target
*.zip
*.tar
*.tar.*