From f7f149e898b1fdcf6490b5badcbe2423b253354d Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Wed, 15 Jan 2025 14:02:20 +0100 Subject: [PATCH] changes --- scripts/tag.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/tag.sh b/scripts/tag.sh index d58d4f6..ba00565 100755 --- a/scripts/tag.sh +++ b/scripts/tag.sh @@ -19,7 +19,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${SCRIPT_DIR}/common.sh" -V_TAG="v$TAG" HAS_UNCOMMITTED=`git status --porcelain=v1 2>/dev/null | wc -l | awk '{print $1}'` if (( $HAS_UNCOMMITTED != 0 )); then echo "You have uncommitted changes, cannot tag." @@ -28,17 +27,16 @@ fi LAST_COMMIT=`git log -1 --oneline` BRANCH=`git rev-parse --abbrev-ref HEAD` -CURRENT_TAG=$(get_spec_version connector.yaml) +CURRENT_TAG=`git describe --tags --abbrev=0` +V_TAG=$(get_spec_version connector.yaml) MSG="You are about to bump the version from ${CURRENT_TAG} to ${V_TAG}.\nCurrent commit is '${LAST_COMMIT}' on branch '${BRANCH}'.\nThe release process is automatic and quick, so if you make a mistake, everyone will see it very soon.\n" + while true; do printf "${MSG}" read -p "Are you sure you want to continue? [y/n]" yn echo case $yn in - [Yy]* ) - git tag -a $V_TAG -m "Release: $V_TAG" - # git push origin $V_TAG - break;; + [Yy]* ) git tag -a $V_TAG -m "Release: $V_TAG" && git push origin $V_TAG; break;; [Nn]* ) exit;; * ) echo "Please answer yes or no.";; esac