From 368ec562cb8a7fa9a5c6526d586be8613357b980 Mon Sep 17 00:00:00 2001 From: Atsushi Neki Date: Thu, 13 Jun 2019 03:29:17 +0000 Subject: [PATCH] FAB-15675 Fix issues flagged by shellcheck For check_license.sh & metrics_doc.sh Need to check with shellcheck 0.6.0 Change-Id: I39c60cf4a9326e9fa5f74159a9f9a199bb77d1fe Signed-off-by: Atsushi Neki --- scripts/check_license.sh | 3 ++- scripts/metrics_doc.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/check_license.sh b/scripts/check_license.sh index 4f33a530af4..9f69b33cfa9 100755 --- a/scripts/check_license.sh +++ b/scripts/check_license.sh @@ -5,7 +5,8 @@ # SPDX-License-Identifier: Apache-2.0 # -source "$(cd $(dirname "$0") && pwd)/functions.sh" +# shellcheck source=/dev/null +source "$(cd "$(dirname "$0")" && pwd)/functions.sh" CHECK=$(git diff --name-only --diff-filter=ACMRTUXB HEAD | tr '\n' ' ') if [[ -z "$CHECK" ]]; then diff --git a/scripts/metrics_doc.sh b/scripts/metrics_doc.sh index 188c29f3265..ab01803804c 100755 --- a/scripts/metrics_doc.sh +++ b/scripts/metrics_doc.sh @@ -14,7 +14,7 @@ case "$1" in # check if the metrics documentation is up to date with the metrics # options in the tree "check") - if [ -n "$(diff -u <(cd ${fabric_dir} && ${gendoc_command}) ${metrics_doc})" ]; then + if [ -n "$(diff -u <(cd "${fabric_dir}" && ${gendoc_command}) "${metrics_doc}")" ]; then echo "The Fabric metrics reference documentation is out of date." echo "Please run '$0 generate' to update the documentation." exit 1 @@ -23,7 +23,7 @@ case "$1" in # generate the metrics documentation "generate") - (cd "${fabric_dir}" && ${gendoc_command} > ${metrics_doc}) + (cd "${fabric_dir}" && ${gendoc_command} > "${metrics_doc}") ;; *)