Browse code

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 <kolyshkin@gmail.com>

Kir Kolyshkin authored on 2019/10/29 11:24:17
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3
+SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4 4
 source "${SCRIPTDIR}/.validate"
5 5
 
6 6
 validate_vendor_diff(){
... ...
@@ -40,9 +40,9 @@ validate_vendor_diff(){
40 40
 validate_vendor_used() {
41 41
 	pkgs=$(mawk '/^[a-zA-Z0-9]/ { print $1 }' < vendor.conf)
42 42
 	for f in $pkgs; do
43
-	if ls -d vendor/$f  > /dev/null 2>&1; then
44
-		found=$(find vendor/$f -iregex '.*LICENSE.*' -or -iregex '.*COPYRIGHT.*' -or -iregex '.*COPYING.*' | wc -l)
45
-		if [ $found -eq 0 ]; then
43
+	if ls -d "vendor/$f"  > /dev/null 2>&1; then
44
+		found=$(find "vendor/$f" -iregex '.*LICENSE.*' -or -iregex '.*COPYRIGHT.*' -or -iregex '.*COPYING.*' | wc -l)
45
+		if [ "$found" -eq 0 ]; then
46 46
 		echo "WARNING: could not find copyright information for $f"
47 47
 		fi
48 48
 	else