shellcheck script, ensure that shellcheck cmd available

This commit is contained in:
2024-12-26 10:41:38 -06:00
parent d0eed5ed17
commit 0cf3810633

View File

@@ -23,14 +23,20 @@ invoke_checker() {
fi fi
} }
echo "inotify watcher started" # chek that 'shellcheck' is available
if ! command -v shellcheck &> /dev/null; then
echo "shellcheck could not be found"
exit 1
fi
echo "initial shellcheck started"
# Run an initial scan of all shell scripts # Run an initial scan of all shell scripts
while IFS= read -rd $'\0' file; do while IFS= read -rd $'\0' file; do
invoke_checker "$file" invoke_checker "$file"
done < <(find "$ROOT" \( -name "*.sh" -o -name "*.sh.tmpl" \) -type f -print0) done < <(find "$ROOT" \( -name "*.sh" -o -name "*.sh.tmpl" \) -type f -print0)
echo "inotifywait invoking" echo "inotifywait started"
inotifywait -mr --quiet --format ' %w %f' -e modify $1 | inotifywait -mr --quiet --format ' %w %f' -e modify $1 |
while read -r dir file; do while read -r dir file; do
absolute_path=${dir}${file} absolute_path=${dir}${file}