Skip to content

Instantly share code, notes, and snippets.

@iamnoah
Created July 12, 2013 14:28
Show Gist options
  • Save iamnoah/5984885 to your computer and use it in GitHub Desktop.
Save iamnoah/5984885 to your computer and use it in GitHub Desktop.
Crude bash script to run my jsshaper quotes and alpha plugins on any file in the current git project that has been modified. i.e., a sort of pre-commit cleanup.
TARGET_DIR="`pwd`/"
cd `dirname $0`
for f in $(cd "$TARGET_DIR" && git status | grep "\.js$" | cut -c14- | awk -v root="$TARGET_DIR" '{ print root $1 }')
do
node run-shaper.js "$f" plugins/quotes.js plugins/alpha.js --source > "$f".fixed
mv "$f"{.fixed,}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment