Skip to content

Instantly share code, notes, and snippets.

@perryjrandall
Last active July 6, 2022 22:34
Show Gist options
  • Select an option

  • Save perryjrandall/b7470d3ae8c349fb853643dfda514a37 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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