From 576208dc964434966f301c635473529ac0a3103e Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 15 Jan 2020 19:09:46 -0500 Subject: [PATCH] Resolve shellcheck SC2001 SC2001: See if you can use ${variable//search/replace} instead. Signed-off-by: Thanh Ha Change-Id: Ib4cce69c29ade0b37c2bffcf9f566f9ab8821b29 --- shell/gerrit-push-patch.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/gerrit-push-patch.sh b/shell/gerrit-push-patch.sh index d0a77fe1..8bddfa9d 100644 --- a/shell/gerrit-push-patch.sh +++ b/shell/gerrit-push-patch.sh @@ -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 -- 2.16.6