Fix shellcheck failures on clean.sh and cache_go_dirs.sh

update pull request
This commit is contained in:
aaa
2019-04-19 13:36:23 -04:00
parent ac1557a886
commit 5f719707f2
3 changed files with 7 additions and 9 deletions

View File

@@ -28,7 +28,7 @@ if [[ -z "${1:-}" ]]; then
fi
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
# remaining arguments.
@@ -62,8 +62,8 @@ if [[ -f "${CACHE}" ]]; then
N=$(kfind -type d -newer "${CACHE}" -print -quit | wc -l)
[[ "${N}" == 0 ]] && NEED_FIND=false
fi
mkdir -p $(dirname "${CACHE}")
if $("${NEED_FIND}"); then
mkdir -p "$(dirname "${CACHE}")"
if ${NEED_FIND}; then
kfind -type f -name \*.go \
| sed 's|/[^/]*$||' \
| sed 's|^./||' \