Skip to content

Instantly share code, notes, and snippets.

@sebastiandedeyne
Created April 12, 2017 07:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sebastiandedeyne/7bb14e6aaa12b1001a9f69761a69709e to your computer and use it in GitHub Desktop.
Save sebastiandedeyne/7bb14e6aaa12b1001a9f69761a69709e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
function pw {
# Register the command you want to run when changes are detected here
run="clear && printf '\e[3J' && vendor/bin/phpunit"
# Retrieve the custom argments. If none are provided, default to "tests"
[[ -n $@ ]] && args=$@ || args="tests"
# Run the command first...
eval "$run $args"
# ...then start watching for changes—and run on change
watchman-make \
# Register files and folders you want to watch here
-p 'src/**/*.php' 'tests/**/*.php' \
--make=$run \
-t "$args"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment