Resolve shellcheck SC2001 25/62825/3
authorThanh Ha <zxiiro@gmail.com>
Thu, 16 Jan 2020 00:09:46 +0000 (19:09 -0500)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 16 Jan 2020 03:33:42 +0000 (03:33 +0000)
SC2001: See if you can use ${variable//search/replace} instead.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: Ib4cce69c29ade0b37c2bffcf9f566f9ab8821b29

shell/gerrit-push-patch.sh

index d0a77fe..8bddfa9 100644 (file)
@@ -44,11 +44,17 @@ set -u
 # End git-review workaround
 # Remove any leading or trailing quotes surrounding the strings
 # which can cause parse errors when passed as CLI options to commands
+# shellcheck disable=SC2001
 PROJECT="$(echo "$PROJECT" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
+# shellcheck disable=SC2001
 GERRIT_COMMIT_MESSAGE="$(echo "$GERRIT_COMMIT_MESSAGE" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
+# shellcheck disable=SC2001
 GERRIT_HOST="$(echo "$GERRIT_HOST" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
+# shellcheck disable=SC2001
 GERRIT_TOPIC="$(echo "$GERRIT_TOPIC" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
+# shellcheck disable=SC2001
 GERRIT_USER="$(echo "$GERRIT_USER" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
+# shellcheck disable=SC2001
 REVIEWERS_EMAIL="$(echo "$REVIEWERS_EMAIL" | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")"
 job=$JOB_NAME/$BUILD_NUMBER