Created
January 25, 2011 02:09
-
-
Save kristjan/794397 to your computer and use it in GitHub Desktop.
Poor man's smart autotest
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
export FILE=file/to/test.rb | |
export MOD=$(stat -c %Y $FILE | cut -d ' ' -f1) | |
while sleep .1 | |
do | |
NEWMOD=$(stat -c %Y $FILE | cut -d ' ' -f1) | |
if [ $NEWMOD -gt $MOD ] | |
then | |
echo Changed $MOD $NEWMOD | |
export MOD=$NEWMOD | |
ruby $FILE | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment