Resolve shellcheck SC2116 useless echo 21/62821/3
authorThanh Ha <zxiiro@gmail.com>
Wed, 15 Jan 2020 23:44:15 +0000 (18:44 -0500)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 16 Jan 2020 03:30:18 +0000 (03:30 +0000)
SC2116: Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'

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

shell/gerrit-fetch-dependencies.sh

index 24542e9..ed42596 100644 (file)
@@ -39,7 +39,7 @@ set -u
 # End git-review workaround
 
 projects=()
-for patch in $(echo "${PATCHES[@]}"); do
+for patch in "${PATCHES[@]}"; do
     json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
     project=$(echo "$json" | jq -r '.project')
     branch=$(echo "$json" | jq -r '.branch')