Last active
August 29, 2015 14:06
-
-
Save billmote/7958483bda295672f0a2 to your computer and use it in GitHub Desktop.
A quick find-and-replace script in support of forking projects.
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 | |
| # chmod +x ./forkproject.sh # make this file executable | |
| # Search and replace {NewRepoName}, {newappname} and {NewAppName} | |
| # NOTE: this will mess up 1 URL in res/values/build_properties.xml, but you'll want your own API endpoint anyway ;) | |
| cd ~/git/{NewRepoName}/app | |
| mv ~/git/{NewRepoName}/app/src/main/java/com/androidfu/foundation ~/git/{NewRepoName}/app/src/main/java/com/androidfu/{newappname} | |
| grep -IRlr com\.androidfu\.foundation . | xargs sed -i "" -e 's/com\.androidfu\.foundation/com\.androidfu\.{newappname}/g' | |
| grep -IRlr foundation . | xargs sed -i "" -e 's/foundation/{newappname}/g' | |
| grep -IRlr Foundation . | xargs sed -i "" -e 's/Foundation/{NewAppName}/g' | |
| mv ~/git/{NewRepoName}/app/src/main/java/com/androidfu/{newappname}/FoundationApplication.java ~/git/{NewRepoName}/app/src/main/java/com/androidfu/{newappname}/{NewAppName}Application.java | |
| mv ~/git/{NewRepoName}/Foundation.iml ~/git/{NewRepoName}/{NewAppName}.iml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment