Skip to content

Instantly share code, notes, and snippets.

@wbednarski
Forked from krystofbe/rename_phoenix_project.sh
Last active September 19, 2024 04:43
Show Gist options
  • Save wbednarski/fcd9a68f600971f6fab6114be44bd403 to your computer and use it in GitHub Desktop.
Save wbednarski/fcd9a68f600971f6fab6114be44bd403 to your computer and use it in GitHub Desktop.
rename a phoenix 1.3 project
#!/bin/bash
set -e
CURRENT_NAME="Zauberantrag"
CURRENT_OTP="zauberantrag"
NEW_NAME="Wunderantrag"
NEW_OTP="wunderantrag"
ack -l $CURRENT_NAME --ignore-file=is:rename_phoenix_project.sh | xargs sed -i '' -e "s/$CURRENT_NAME/$NEW_NAME/g"
ack -l $CURRENT_OTP --ignore-file=is:rename_phoenix_project.sh | xargs sed -i '' -e "s/$CURRENT_OTP/$NEW_OTP/g"
git mv lib/$CURRENT_OTP lib/$NEW_OTP
git mv lib/$CURRENT_OTP.ex lib/$NEW_OTP.ex
git mv lib/${CURRENT_OTP}_web lib/${NEW_OTP}_web
git mv lib/${CURRENT_OTP}_web.ex lib/${NEW_OTP}_web.ex
git mv test/$CURRENT_OTP test/$NEW_OTP
git mv test/${CURRENT_OTP}_web test/${NEW_OTP}_web
@wbednarski
Copy link
Author

Won't break Git history.

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