fswatch

Monitor directory for changes and execute shell commands

brewmacoslinux
Try with needOr install directly
Source

About

Monitor a directory for changes and run a shell command

Commands

fswatch

Examples

Monitor current directory and run a command on any file change$ fswatch . | xargs -n 1 echo
Watch a specific directory and rebuild on changes$ fswatch src/ | xargs -I {} make build
Monitor files matching a pattern and run a test script$ fswatch -e '.*' -i '\.js$' . | xargs -I {} npm test