Created
October 27, 2011 22:10
-
-
Save benjaminpearson/1321051 to your computer and use it in GitHub Desktop.
Remove Whitespace in Xcode as a Build Phase
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
- IMPORTANT: Using this will kill your undo history | |
Steps: | |
- In Xcode > Select your project > "Build Phases" > "Add Build Phase" > "Add Run Script" | |
- Paste this script: | |
sed -i '' 's/[[:space:]]*$//' `find . -name *.h -o -name *.m -not \( -name .svn -prune -o -name .git -prune \) -type f` | |
- Now whitespace will be removed from .h and .m files on build | |
- Only problem, doesn't work if path contains a space.... any ideas? | |
- NOTE: don't try this script out on your super important project that you haven't committed your changes to yet, I'm not a terminal pro and this could do something crazy that I haven't expected ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment