Skip to content

Commit

Permalink
Modify release script to distinguish git tag errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LeiGlobus committed Dec 6, 2024
1 parent 0870047 commit 27486d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ if ! grep '^globus\-compute\-sdk \& globus\-compute\-endpoint v'"$VERSION"'$' do
fi

echo "releasing v$VERSION"
if git tag -s -m "v$VERSION" "$VERSION" ; then
TAG_STDERR="$(git tag -s -m \"v$VERSION\" \"$VERSION\" 2>&1 > /dev/null)"
if [[ $? == 0 ]]; then
echo "Git tagged $VERSION"
git push origin "$VERSION"
else
elif [[ "$TAG_STDERR" =~ "already exists" ]]; then
read -p "Tag $VERSION already exists. Release packages with this tag anyway? [y/n] " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
[[ $0 = $BASH_SOURCE ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi
else
echo Git tag failed: "$TAG_STDERR"
[[ $0 = $BASH_SOURCE ]] && exit 1
fi

pushd compute_sdk
Expand Down

0 comments on commit 27486d5

Please sign in to comment.