Created
August 13, 2015 00:14
-
-
Save frankus/f13830ea658bed55ca41 to your computer and use it in GitHub Desktop.
Updates Xcode's default file-header comment to correct filename
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
| find . -iname '*.[mh]' -print0 | while IFS= read -r -d '' file; do basename=`basename "$file"`; sed -i .bak "2s|// .*\$|// $basename|" "$file"; done |
Author
Author
Updated for Swift files:
find . -iname '*.swift' -print0 | while IFS= read -r -d '' file; do basename=`basename "$file"`; sed -i .bak "2s|// .*\$|// $basename|" "$file"; done
Author
To delete backup files:
find . -name "*.bak" -delete
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A few notes:
-lastPathComponent)..bakwith an empty set of quotes (''). Otherwise you can clean up the .bak files withfind . -iname '*.bak' -exec rm "{}" \;.