Forked from sebastiandedeyne/phpunit-watcher-annotated.sh
Last active
May 3, 2017 08:50
-
-
Save codyphobe/d7010a7e7c0c09f1100f0045234a03ec to your computer and use it in GitHub Desktop.
This file contains 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 { | |
# Set the command that should run when changes are detected | |
run="clear && printf '\e[3J' && vendor/bin/phpunit" | |
# Retrieve the custom arguments, defaulting to "tests" | |
[[ -n $@ ]] && args=$@ || args="tests" | |
# Run the command first... | |
eval "$run $args" | |
# ...then start watching for changes and run again on each change | |
watchman-make \ | |
# Set the files and folders to be watched | |
-p 'app/**/*.php' 'database/**/*.php' '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