Skip to content

Instantly share code, notes, and snippets.

@zdennis
Created August 15, 2018 18:41
Show Gist options
  • Save zdennis/d9e1f0b2e74897d7090247d8fee13c6b to your computer and use it in GitHub Desktop.
Save zdennis/d9e1f0b2e74897d7090247d8fee13c6b to your computer and use it in GitHub Desktop.
Poor man's rubocop guard/watcher.
compute_hash() {
git s | grep $1 | cut -d" " -f2 | xargs cat | md5
}
HSH=`compute_hash rb`
for i in `seq 1 100000` ; do
NHSH=`compute_hash rb`
if [ "$HSH" != "$NHSH" ] ; then
git s | grep rb | xargs rubocop
else
echo -n '.'
fi
HSH=$NHSH
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment