pub / stagit-scripts

Building src.jayvii.de with stagit
git clone https://src.jayvii.de/pub/stagit-scripts.git
Home | Log | Files | Exports | Refs | README | RSS

commit d83b37ba682beb807be21d479fb49f7460c5dc4f
parent d2ca54beaba67ff4176ae80b56134cec26c8f589
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Sun, 28 Apr 2024 20:59:23 +0200

Calculate sha256sum for export

Diffstat:
Mbin/git_export_tarball.sh | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/bin/git_export_tarball.sh b/bin/git_export_tarball.sh @@ -20,7 +20,12 @@ fi # Git-Repository cd "${1}/${2}/${3}.git" || exit 1; -# Create tarball and place it in the export-directory -git archive --format=tar.gz -o "${1}/${2}/${3}.exp/main.tar.gz" main && -echo "Archive can be retrieved from ${2}/${3}.exp/main.tar.gz" +# Get current branch name +BRANCH=`git branch --show-current || echo "current"` + +# Create tarball and sha256. place them in the export-directory +git archive --format=tar.gz -o "${BRANCH}.tar.gz" ${BRANCH} && +sha256sum "${BRANCH}.tar.gz" > "${1}/${2}/${3}.exp/${BRANCH}.tar.gz.sha256" && +mv "${BRANCH}.tar.gz" "${1}/${2}/${3}.exp/${BRANCH}.tar.gz" && +echo "Archive can be retrieved from ${2}/${3}.exp/${BRANCH}.tar.gz"