From d1398e5bbc5991f4f9fec785931333a278f0361e Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Thu, 9 Mar 2017 01:22:46 -0500 Subject: [PATCH] Ignore ShellCheck rule SC2046 Not sure how to resolve this at the moment. If we quote it as suggested the check fails and compare with -eq 0. Ignore this ShellCheck for now until we figure out a proper solution. Change-Id: I4b14d3db442a2cba8020b4823ef8c5b87ce5ccea Signed-off-by: Thanh Ha --- packer/provision/baseline.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packer/provision/baseline.sh b/packer/provision/baseline.sh index 38b6ac2e0..3841b2021 100644 --- a/packer/provision/baseline.sh +++ b/packer/provision/baseline.sh @@ -157,7 +157,8 @@ EOF for pkg in unzip xz-utils puppet git git-review libxml-xpath-perl do - if dpkg-query -W -f='${Status}' $pkg 2>/dev/null | grep -c "ok installed"; then + # shellcheck disable=SC2046 + if [ $(dpkg-query -W -f='${Status}' $pkg 2>/dev/null | grep -c "ok installed") -eq 0 ]; then apt-get install $pkg fi done -- 2.36.6