Fix shellcheck failures on clean.sh and cache_go_dirs.sh
update pull request
This commit is contained in:
		@@ -30,8 +30,6 @@
 | 
				
			|||||||
./hack/lib/swagger.sh
 | 
					./hack/lib/swagger.sh
 | 
				
			||||||
./hack/lib/test.sh
 | 
					./hack/lib/test.sh
 | 
				
			||||||
./hack/lib/version.sh
 | 
					./hack/lib/version.sh
 | 
				
			||||||
./hack/make-rules/clean.sh
 | 
					 | 
				
			||||||
./hack/make-rules/helpers/cache_go_dirs.sh
 | 
					 | 
				
			||||||
./hack/make-rules/make-help.sh
 | 
					./hack/make-rules/make-help.sh
 | 
				
			||||||
./hack/make-rules/test.sh
 | 
					./hack/make-rules/test.sh
 | 
				
			||||||
./hack/make-rules/update.sh
 | 
					./hack/make-rules/update.sh
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,7 @@ set -o errexit
 | 
				
			|||||||
set -o nounset
 | 
					set -o nounset
 | 
				
			||||||
set -o pipefail
 | 
					set -o pipefail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
 | 
					KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
 | 
				
			||||||
source "${KUBE_ROOT}/hack/lib/util.sh"
 | 
					source "${KUBE_ROOT}/hack/lib/util.sh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CLEAN_PATTERNS=(
 | 
					CLEAN_PATTERNS=(
 | 
				
			||||||
@@ -28,11 +28,11 @@ CLEAN_PATTERNS=(
 | 
				
			|||||||
  "test/e2e/generated/bindata.go"
 | 
					  "test/e2e/generated/bindata.go"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for pattern in ${CLEAN_PATTERNS[@]}; do
 | 
					for pattern in "${CLEAN_PATTERNS[@]}"; do
 | 
				
			||||||
  for match in $(find "${KUBE_ROOT}" -iregex "^${KUBE_ROOT}/${pattern}$"); do
 | 
					  while IFS=$'\n' read -r -d match; do
 | 
				
			||||||
    echo "Removing ${match#${KUBE_ROOT}\/} .."
 | 
					    echo "Removing ${match#${KUBE_ROOT}\/} .."
 | 
				
			||||||
    rm -rf "${match#${KUBE_ROOT}\/}"
 | 
					    rm -rf "${match#${KUBE_ROOT}\/}"
 | 
				
			||||||
  done
 | 
					  done <   <(find "${KUBE_ROOT}" -iregex "^${KUBE_ROOT}/${pattern}$")
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ex: ts=2 sw=2 et filetype=sh
 | 
					# ex: ts=2 sw=2 et filetype=sh
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@ if [[ -z "${1:-}" ]]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
CACHE="$1"; shift
 | 
					CACHE="$1"; shift
 | 
				
			||||||
 | 
					
 | 
				
			||||||
trap "rm -f '${CACHE}'" HUP INT TERM ERR
 | 
					trap 'rm -f "${CACHE}"' HUP INT TERM ERR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This is a partial 'find' command.  The caller is expected to pass the
 | 
					# This is a partial 'find' command.  The caller is expected to pass the
 | 
				
			||||||
# remaining arguments.
 | 
					# remaining arguments.
 | 
				
			||||||
@@ -62,8 +62,8 @@ if [[ -f "${CACHE}" ]]; then
 | 
				
			|||||||
    N=$(kfind -type d -newer "${CACHE}" -print -quit | wc -l)
 | 
					    N=$(kfind -type d -newer "${CACHE}" -print -quit | wc -l)
 | 
				
			||||||
    [[ "${N}" == 0 ]] && NEED_FIND=false
 | 
					    [[ "${N}" == 0 ]] && NEED_FIND=false
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
mkdir -p $(dirname "${CACHE}")
 | 
					mkdir -p "$(dirname "${CACHE}")"
 | 
				
			||||||
if $("${NEED_FIND}"); then
 | 
					if ${NEED_FIND}; then
 | 
				
			||||||
    kfind -type f -name \*.go  \
 | 
					    kfind -type f -name \*.go  \
 | 
				
			||||||
        | sed 's|/[^/]*$||'    \
 | 
					        | sed 's|/[^/]*$||'    \
 | 
				
			||||||
        | sed 's|^./||'        \
 | 
					        | sed 's|^./||'        \
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user