Created
April 12, 2017 07:15
-
-
Save sebastiandedeyne/7bb14e6aaa12b1001a9f69761a69709e to your computer and use it in GitHub Desktop.
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
#!/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