Last active
July 6, 2022 22:34
-
-
Save perryjrandall/b7470d3ae8c349fb853643dfda514a37 to your computer and use it in GitHub Desktop.
Cli to run only when files are changed in the repo path, requires watchman
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 -x | |
| to_watch="$1" | |
| shift | |
| to_run="$@" | |
| "$@" | |
| while :; do | |
| watchman-wait "$to_watch" && time "$@" | |
| if [[ $? -ne 0 ]]; then | |
| echo "Ctrl C to exit" | |
| sleep 5 || break | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment