Skip to content

Instantly share code, notes, and snippets.

@lytedev
Created March 26, 2015 18:44
Show Gist options
  • Select an option

  • Save lytedev/2e93c8509e82083b2bea to your computer and use it in GitHub Desktop.

Select an option

Save lytedev/2e93c8509e82083b2bea to your computer and use it in GitHub Desktop.
OSX Run arbitrary shell command on change to file(s) in given path(s)
# This quick snippet comes in very handy when writing unit tests or
# quick scripts that iterate very quickly where you need to see the
# result.
# You'll need to install fswatch with `brew install fswatch`
fswatch-run path "$PATH_1" "$PATH_2" "$PATH_N" "$COMMAND"
# Here are some examples
# Compile rust crate on source file change
fswatch-run path src "cargo build"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment