Skip to content

Instantly share code, notes, and snippets.

@shaunlee
Last active March 2, 2016 10:27
Show Gist options
  • Save shaunlee/6657121 to your computer and use it in GitHub Desktop.
Save shaunlee/6657121 to your computer and use it in GitHub Desktop.
/usr/local/bin/phpcs4hg
#!/bin/bash
while [ ! -d .hg ]; do
cd ..
[ -f proc/cpuinfo ] && break
done
[ ! -d .hg ] && echo 'Oops! No hg repository found.' && exit
for f in `hg st | awk '{print $2}'`; do
[ ! -f $f ] && continue
[[ $f =~ config.*?php$ ]] && continue
[[ $f =~ .php$ ]] && phpcs $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment