From 914ad6c54e018f32fe1cacbe186c4ba1ef9e4343 Mon Sep 17 00:00:00 2001 From: Tim Man Date: Thu, 11 Jan 2024 23:22:09 +0800 Subject: [PATCH] chore: fix find tag script --- scripts/find-tag.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/find-tag.sh b/scripts/find-tag.sh index c190ca360..be974b155 100755 --- a/scripts/find-tag.sh +++ b/scripts/find-tag.sh @@ -12,13 +12,14 @@ fi if cat releases.json | jq '.[].tag_name' | grep $TAG; then echo found releases matching $TAG - LATEST_TAG=$(cat releases.json | jq '.[].tag_name' | grep $TAG | head -1) - LATEST_RC=$(echo $LATEST_TAG | grep rc | sed 's/.*-rc\(.*\)/\1/') + LATEST_TAG=$(cat releases.json | jq -r '.[].tag_name' | grep $TAG | head -1) + LATEST_RC=$(echo $LATEST_TAG | grep rc | sed 's/.*-rc.\(.*\)/\1/') if [[ -z "$LATEST_RC" ]]; then echo $TAG was already released exit 1; elif [[ -n "$LATEST_RC" ]]; then - NEXT_TAG="$TAG-rc.$($LATEST_RC +1)" + ((LATEST_RC++)) + NEXT_TAG="$TAG-rc.$LATEST_RC" fi else echo no releases matching $TAG yet