Created
June 21, 2012 20:35
-
-
Save atomic-penguin/2968356 to your computer and use it in GitHub Desktop.
Foodcritic FC001 fixer script.
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
#!/bin/bash | |
if [ "$#" -eq 0 ]; then | |
echo "Usage: `basename $0` <cookbook directory>" | |
elif [ "$#" -eq 1 ]; then | |
find $1 -name "*[.md|.rb]" ! -name "*.git" ! -name "*.erb" | xargs perl -p -e 's!\[:([a-z0-9_]+)\]![\x27$1\x27]!gi' -i | |
echo "Commit message:" | |
echo "FC001: Use strings in preference to symbols to access node attributes" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Super handy! Thanks!