From fb25c893bf16bbb6ba18de9963bea6503696f226 Mon Sep 17 00:00:00 2001 From: Pallavi Sontakke Date: Mon, 23 Sep 2024 17:17:51 +0530 Subject: [PATCH] Edit the way we set some derived variables To fix the shellcheck style issue: ^-- SC2116 (style): Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'. --- scripts/release/create_minor_release_PR_commit.sh | 3 ++- scripts/release/create_minor_release_branch.sh | 2 +- scripts/release/create_release_PR_commit.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/release/create_minor_release_PR_commit.sh b/scripts/release/create_minor_release_PR_commit.sh index 3960870000b..b5ad22cb784 100755 --- a/scripts/release/create_minor_release_PR_commit.sh +++ b/scripts/release/create_minor_release_PR_commit.sh @@ -15,7 +15,7 @@ git fetch --all NEW_PATCH_VERSION="0" NEW_VERSION=$(head -1 version.config | cut -d ' ' -f 3 | cut -d '-' -f 1) -RELEASE_BRANCH=$(echo "${NEW_VERSION/%.$NEW_PATCH_VERSION/.x}") +RELEASE_BRANCH="${NEW_VERSION/%.$NEW_PATCH_VERSION/.x}" CURRENT_VERSION=$(tail -1 version.config | cut -d ' ' -f 3) cd sql/updates LAST_VERSION=$(ls |grep $CURRENT_VERSION.sql |cut -d '-' -f 1) @@ -38,6 +38,7 @@ LAST_DOWNGRADE_FILE="$CURRENT_VERSION--$LAST_VERSION.sql" echo "---- Creating release branch $RELEASE_PR_BRANCH from $RELEASE_BRANCH, on the fork ----" git checkout -b "$RELEASE_PR_BRANCH" upstream/"$RELEASE_BRANCH" +#git checkout -b "$RELEASE_PR_BRANCH" upstream/main git branch git pull && git diff HEAD diff --git a/scripts/release/create_minor_release_branch.sh b/scripts/release/create_minor_release_branch.sh index e582e66cb74..3945943395d 100755 --- a/scripts/release/create_minor_release_branch.sh +++ b/scripts/release/create_minor_release_branch.sh @@ -17,7 +17,7 @@ NEW_PATCH_VERSION="0" NEW_VERSION=$(head -1 version.config | cut -d ' ' -f 3 | cut -d '-' -f 1) -RELEASE_BRANCH=$(echo "${NEW_VERSION/%.$NEW_PATCH_VERSION/.x}") +RELEASE_BRANCH="${NEW_VERSION/%.$NEW_PATCH_VERSION/.x}" echo "RELEASE_BRANCH is $RELEASE_BRANCH" echo "NEW_VERSION is $NEW_VERSION" diff --git a/scripts/release/create_release_PR_commit.sh b/scripts/release/create_release_PR_commit.sh index 7dbc2b7f345..942515686c6 100755 --- a/scripts/release/create_release_PR_commit.sh +++ b/scripts/release/create_release_PR_commit.sh @@ -18,8 +18,8 @@ cd sql/updates LAST_VERSION=$(ls |grep $CURRENT_VERSION.sql |cut -d '-' -f 1) CURRENT_PATCH_VERSION=$(echo $CURRENT_VERSION | cut -d '.' -f 3) NEW_PATCH_VERSION=$((CURRENT_PATCH_VERSION + 1)) -RELEASE_BRANCH=$(echo "${CURRENT_VERSION/%.$CURRENT_PATCH_VERSION/.x}") -NEW_VERSION=$(echo "${CURRENT_VERSION/%.$CURRENT_PATCH_VERSION/.$NEW_PATCH_VERSION}") +RELEASE_BRANCH="${CURRENT_VERSION/%.$CURRENT_PATCH_VERSION/.x}" +NEW_VERSION="${CURRENT_VERSION/%.$CURRENT_PATCH_VERSION/.$NEW_PATCH_VERSION}" echo "CURRENT_VERSION is $CURRENT_VERSION" echo "LAST_VERSION is $LAST_VERSION"