From 4be12ad3d04aefe6d5822d426813b33d2d4f9a7e Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 28 Oct 2019 19:24:17 -0700 Subject: [PATCH] hack/validate/vendor: shellcheck fixes The export statement is definitely not needed. The rest is obvious. > In hack/validate/vendor line 3: > export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" > ^-- SC2155: Declare and assign separately to avoid masking return values. > > > In hack/validate/vendor line 43: > if ls -d vendor/$f > /dev/null 2>&1; then > ^-- SC2086: Double quote to prevent globbing and word splitting. > > > In hack/validate/vendor line 44: > found=$(find vendor/$f -iregex '.*LICENSE.*' -or -iregex '.*COPYRIGHT.*' -or -iregex '.*COPYING.*' | wc -l) > ^-- SC2086: Double quote to prevent globbing and word splitting. > > > In hack/validate/vendor line 45: > if [ $found -eq 0 ]; then > ^-- SC2086: Double quote to prevent globbing and word splitting. Signed-off-by: Kir Kolyshkin --- hack/validate/vendor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/validate/vendor b/hack/validate/vendor index 93fb4a1e8b..0995be2f3b 100755 --- a/hack/validate/vendor +++ b/hack/validate/vendor @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${SCRIPTDIR}/.validate" validate_vendor_diff(){ @@ -40,9 +40,9 @@ validate_vendor_diff(){ validate_vendor_used() { pkgs=$(mawk '/^[a-zA-Z0-9]/ { print $1 }' < vendor.conf) for f in $pkgs; do - if ls -d vendor/$f > /dev/null 2>&1; then - found=$(find vendor/$f -iregex '.*LICENSE.*' -or -iregex '.*COPYRIGHT.*' -or -iregex '.*COPYING.*' | wc -l) - if [ $found -eq 0 ]; then + if ls -d "vendor/$f" > /dev/null 2>&1; then + found=$(find "vendor/$f" -iregex '.*LICENSE.*' -or -iregex '.*COPYRIGHT.*' -or -iregex '.*COPYING.*' | wc -l) + if [ "$found" -eq 0 ]; then echo "WARNING: could not find copyright information for $f" fi else