I've cloned a git
repo and I need to start a new project based off of it.
How do I rename it, making sure everything is taken care of?
I'm using macOS.
Based off of nerdyworm's rename.sh, that uses ack
I've adapted it to use git grep
and run on macOS easily.
• OTP NAME: Snake Case (snake_case) name for the Application.
• NAME: Regular app name.
$ git grep -l $CURRENT_OTP | xargs sed -i '' -e "s/$CURRENT_OTP/$NEW_OTP/g"
$ git grep -l $CURRENT_NAME | xargs sed -i '' -e "s/$CURRENT_NAME/$NEW_NAME/g"
$ mv lib/$CURRENT_OTP lib/$NEW_OTP
$ mv lib/$CURRENT_OTP.ex lib/$NEW_OTP.ex
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With