mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-08 10:06:56 -06:00
shellcheck script, ensure that shellcheck cmd available
This commit is contained in:
10
.vscode/shellchecker.sh
vendored
10
.vscode/shellchecker.sh
vendored
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user