Created
June 5, 2010 16:36
-
-
Save mystix/426758 to your computer and use it in GitHub Desktop.
JavaScript cleanup script
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 | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 FILENAME" | |
exit 1 | |
fi | |
# 1) convert file to unix line endings | |
# 2) converts tab characters to 4 spaces | |
# 3) collapse multi-line c-style comments, then strip them from source | |
# 4) trim trailing whitespace | |
# | |
# note: this script requires the reccoms.sh script as well | |
dos2unix < $1 | expand -t4 | ./remccoms.sh | sed 's/[ \t]*$//' > $1.tmp | |
mv $1.tmp $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment