Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@markburns
Created March 6, 2017 17:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markburns/d92962f153f18c913eb838a558a635ea to your computer and use it in GitHub Desktop.
Save markburns/d92962f153f18c913eb838a558a635ea to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
function exists(){
while read line
do
if [ -e $line ]
then
echo $line
fi
done < "${1:-/dev/stdin}"
}
git diff --name-only master head | grep "\.rb$" | exists | xargs rubocop -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment