Created
February 27, 2019 13:28
-
-
Save 2ec0b4/fb35f4dee6048c658a19c0c22de6d7cf to your computer and use it in GitHub Desktop.
Watch for file changes and do something
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script requires [entr](http://entrproject.org): `brew install entr` | |
# Tested on macOS Mojave | |
while true; do | |
# Watch for files changes or new files in the current directory, except in ./dist, ./vendor and ./.git, and execute ./do-something.sh | |
find . \( -path "./dist" -o -path "./vendor" -o -path "./.git" \) -prune -o -print | entr -d ./do-something.sh | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment