Created
March 1, 2015 09:50
-
-
Save wknar/21c13200bae7d489896b 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
[alias] | |
st = "!f(){ \ | |
git status; \ | |
echo \"\n ====== Syntax Check ======\"; \ | |
git status --short | while read line; \ | |
do \ | |
if [[ $line =~ ^.*\\.(php)$ ]]; then \ | |
php -l `echo $line | sed -e \"s/M //g\"` > /dev/null; \ | |
[[ $? == 0 ]] && st=32 || st=33; \ | |
echo \"\\033[0;$(echo $st)m$(php -l `echo $line | sed -e \"s/M //g\"`)\\033[0;39m\"; \ | |
fi; \ | |
done; \ | |
};f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment