From affa7119ee216ab73d330d1bbf6b182647f667c9 Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sun, 15 Mar 2026 12:38:46 +0100 Subject: [PATCH] fixed documentation (#13) Reviewed-on: https://gitea.netzwissen.de/lxcafe/lxcafe/pulls/13 --- 02_finalise_release.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/02_finalise_release.sh b/02_finalise_release.sh index 7168856..2dbd5ec 100755 --- a/02_finalise_release.sh +++ b/02_finalise_release.sh @@ -24,6 +24,25 @@ CURRENT_VERSION=$(cat "$VERSION_FILE" | tr -d '\n') echo "Finalising release of version: $CURRENT_VERSION" +RELEASE_BRANCH="release/$CURRENT_VERSION" + +_local_exists=false +if git rev-parse "$RELEASE_BRANCH" >/dev/null 2>&1; then + _local_exists=true +fi + +_remote_exists=false +if git ls-remote --heads origin "$RELEASE_BRANCH" 2>/dev/null | grep -q .; then + _remote_exists=true +fi + +if [ "$_local_exists" = "true" ] || [ "$_remote_exists" = "true" ]; then + if question_answered_with_yes "Delete release branch $RELEASE_BRANCH (local and remote)?"; then + [ "$_local_exists" = "true" ] && git branch -D "$RELEASE_BRANCH" + [ "$_remote_exists" = "true" ] && git push origin --delete "$RELEASE_BRANCH" + fi +fi + if ! question_answered_with_yes "Create tag $CURRENT_VERSION on main?"; then echo "Tag creation aborted." exit 0