-
-
Save fiunchinho/6960921 to your computer and use it in GitHub Desktop.
Watch for changes in files (code and tests) and run phpunit tests whenever changes are detected. Althought is not needed, I recommend to use a phpunit.xml configuration file.
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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 CODE-DIRECTORY" | |
exit 1 | |
fi | |
code_directory=$1 | |
if [ ! -d $code_directory ]; then | |
echo "Error: invalid dir $code_directory" | |
exit 1 | |
fi | |
while inotifywait -qq -e close_write -r $code_directory --exclude=".*sw[px]"; do | |
clear && phpunit $code_directory | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment