Skip to content

Instantly share code, notes, and snippets.

@dcosson
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcosson/27bcca9b9ad28a38ab60 to your computer and use it in GitHub Desktop.
Save dcosson/27bcca9b9ad28a38ab60 to your computer and use it in GitHub Desktop.
Rename an ios project

I was renaming a project from GrowthKit to Mave, and updating the prefix.

This got me 95% of the way there, there were a few things to clean up manually (not really sure why because the things I fixed manually matched these rules). Luckily the previous project name wasn't "View" or something that would conflict with any builtin types or setting names

rm -rf Pods
brew install rename 
shopt -s globstar     # requires bash 4.0+, makes ** recursive

rename s/GrowthKit/Mave/ **
rename s/GRK/MAVE/ **

find -E . -regex '.*\.(h|m|storyboard|xib|pbxproj|xcworkspacedata)$' -exec perl -pi -e 's/GRK/MAVE/g;' {} +
find -E . -regex '.*\.(h|m|storyboard|xib|pbxproj|xcworkspacedata)$' -exec perl -pi -e 's/GrowthKit/Mave/g;' {} +
find . -name Podfile -exec perl -pi -e 's/GRK/MAVE/g;' {} +
find . -name Podfile -exec perl -pi -e 's/GrowthKit/Mave/g;' {} +

pod install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment