Files
ffmpeg-builder/shfmt-watcher.sh
2025-08-07 20:14:10 -05:00

13 lines
270 B
Bash
Executable File

#!/usr/bin/env bash
base="$(dirname "$(readlink -f "$0")")"
inotifywait -m -r \
-e close_write \
-e moved_to \
--format '%w%f' "$base/lib" "$base/scripts" | while read -r file; do
if [[ -f $file && $file =~ .sh ]]; then
shfmt --write --simplify "$file"
fi
done