mirror of
https://github.com/ben-grande/qusal.git
synced 2025-08-18 10:47:58 -04:00
Fail
This commit is contained in:
parent
6fb526768f
commit
fd1e064178
6 changed files with 51 additions and 12 deletions
|
@ -24,9 +24,23 @@ elif command -v fdfind >/dev/null; then
|
|||
find_tool="fdfind"
|
||||
fi
|
||||
|
||||
if test -n "${1-}"; then
|
||||
files=""
|
||||
for f in "$@"; do
|
||||
test -f "$f" || continue
|
||||
extension="$(echo "$f" | awk -F '.' '{print $NF}')"
|
||||
case "$extension" in
|
||||
top|sls) files="$files $f";;
|
||||
*) continue;;
|
||||
esac
|
||||
done
|
||||
test -n "$files" || exit 0
|
||||
exec salt-lint ${conf} ${files}
|
||||
fi
|
||||
|
||||
case "${find_tool}" in
|
||||
fd|fdfind) files="minion.d/qusal.conf $(${find_tool} . qusal/ --max-depth=2 --type=f --extension=sls --extension=top)";;
|
||||
find) files="minion.d/qusal.conf $(find qusal/* -maxdepth 2 -type f \( -name '*.sls' -o -name '*.top' \))";;
|
||||
esac
|
||||
|
||||
salt-lint ${conf} ${files}
|
||||
exec salt-lint ${conf} ${files}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue