Last active
August 29, 2015 14:02
-
-
Save amenasse/a006dacc3fdd15d1fcde to your computer and use it in GitHub Desktop.
runs django tests when a python file in the given directory changes and play some audio if it fails
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
#!/bin/bash | |
# runs django tests when a python file in the given directory changes | |
# complain loudly if they fail. Only works on OSX right now | |
# requires fswatch: https://github.com/alandipert/fswatch | |
trap "exit" SIGINT | |
command="python manage.py test --noinput" | |
fswatch "$1" | while read line; do | |
if [[ $line =~ py$ ]]; then | |
${command} | |
[[ $? -ne 0 ]] && afplay ~/beep.wav | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment