Skip to content

Instantly share code, notes, and snippets.

@wknar
Created March 1, 2015 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wknar/21c13200bae7d489896b to your computer and use it in GitHub Desktop.
Save wknar/21c13200bae7d489896b to your computer and use it in GitHub Desktop.
[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