Declare variables separately when assigning the result of $()

This commit is contained in:
Kamil Śliwak
2021-03-04 16:53:05 +01:00
parent 1c7cc376d1
commit 75b87d159d
3 changed files with 6 additions and 6 deletions
@@ -86,7 +86,7 @@ function process_tag() {
local TAG=$1
cd /src
# Checkout the historic commit instead of the tag directly.
local HISTORIC_COMMIT_HASH="$(grep "${TAG}+" /tmp/release_commit_list.txt | cut -d '+' -f 2 | cut -d '.' -f 2)"
local HISTORIC_COMMIT_HASH; HISTORIC_COMMIT_HASH="$(grep "${TAG}+" /tmp/release_commit_list.txt | cut -d '+' -f 2 | cut -d '.' -f 2)"
if [ "$(git cat-file -t "${HISTORIC_COMMIT_HASH}" 2>/dev/null)" == "commit" ]; then
clean_git_checkout "$HISTORIC_COMMIT_HASH"
else
@@ -103,7 +103,7 @@ function process_tag() {
VERSION=$(echo "$TAG" | cut -d v -f 2)
fi
local COMMIT_HASH=$(git rev-parse --short=8 HEAD)
local COMMIT_HASH; COMMIT_HASH=$(git rev-parse --short=8 HEAD)
local FULL_VERSION_SUFFIX="${TAG}+commit.${COMMIT_HASH}"
local HISTORIC_VERSION_SUFFIX="${TAG}+commit.${HISTORIC_COMMIT_HASH}"