浏览代码

Make ruby/run_distrib_test.sh to pass shellcheck (with suppression)

Mehrdad Afshari 7 年之前
父节点
当前提交
c6e82b6872
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      test/distrib/ruby/run_distrib_test.sh

+ 7 - 5
test/distrib/ruby/run_distrib_test.sh

@@ -15,20 +15,22 @@
 
 
 set -ex
 set -ex
 
 
-cd $(dirname $0)
+cd "$(dirname "$0")"
 
 
 ARCH=$1
 ARCH=$1
 PLATFORM=$2
 PLATFORM=$2
 # Create an indexed local gem source with gRPC gems to test
 # Create an indexed local gem source with gRPC gems to test
 GEM_SOURCE=../../../gem_source
 GEM_SOURCE=../../../gem_source
-mkdir -p ${GEM_SOURCE}/gems
-cp $EXTERNAL_GIT_ROOT/input_artifacts/grpc-*$ARCH-$PLATFORM.gem ${GEM_SOURCE}/gems
-if [[ "$(ls ${GEM_SOURCE}/gems | grep grpc | wc -l)" != 1 ]]; then
+mkdir -p "${GEM_SOURCE}/gems"
+cp "$EXTERNAL_GIT_ROOT"/input_artifacts/grpc-*"$ARCH-$PLATFORM".gem "${GEM_SOURCE}/gems"
+# TODO: rewrite the following line to be shellcheck-compliant
+# shellcheck disable=SC2010
+if [[ "$(ls "${GEM_SOURCE}/gems" | grep -c grpc)" != 1 ]]; then
   echo "Sanity check failed. Copied over more than one grpc gem into the gem source directory."
   echo "Sanity check failed. Copied over more than one grpc gem into the gem source directory."
   exit 1
   exit 1
 fi;
 fi;
 gem install builder
 gem install builder
-gem generate_index --directory ${GEM_SOURCE}
+gem generate_index --directory "${GEM_SOURCE}"
 
 
 bundle install
 bundle install