This commit is contained in:
Ben Grande 2023-11-06 16:26:00 +00:00
parent 6fb526768f
commit fd1e064178
No known key found for this signature in database
GPG key ID: 00C64E14F51F9E56
6 changed files with 51 additions and 12 deletions

View file

@ -26,6 +26,27 @@ elif command -v fdfind >/dev/null; then
find_tool="fdfind"
fi
if test -n "${1-}"; then
files=""
sh_files=""
for f in "$@"; do
test -f "$f" || continue
if test "${f##*/}" = "rc.local"; then
sh_files="$sh_files $f"
continue
fi
case $( file -bi "$f" ) in
(*/x-shellscript*) files="$files $f";;
esac
done
if test -n "$files" || test -n "$sh_files"; then
exit 0
fi
test -z "$files" || shellcheck ${files}
test -z "$sh_files" || shellcheck -s sh ${sh_files}
exit
fi
case "${find_tool}" in
fd|fdfind)
# shellcheck disable=2016,2215