Created
March 8, 2016 00:55
-
-
Save sbisbee/ba77b1cca728bfb4a975 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Looks for jshint unnecessary semicolon errors and automatically strips them | |
# out, dealing with trailing white spaces. | |
IFS=$'\n' | |
for line in $(./node_modules/.bin/jshint ./lib | grep 'Unnecessary semicolon'); | |
file=$(echo $line | sed -e 's/: .*//') | |
lNum=$(echo $line | sed -e 's/.* line \([0-9]*\),.*/\1/') | |
sed -i -e "$lNum s/ *$//" -e "$lNum s/;$//" $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment