Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso committed Jan 15, 2025
1 parent 2adf914 commit f7f149e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scripts/tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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
Expand Down

0 comments on commit f7f149e

Please sign in to comment.