Skip to content

Instantly share code, notes, and snippets.

@dfalmeida
Forked from kumekay/rename_phoenix_project.sh
Last active November 8, 2018 11:29
Show Gist options
  • Save dfalmeida/a9b2eccf447fe180e4acc4e8af6a447e to your computer and use it in GitHub Desktop.
Save dfalmeida/a9b2eccf447fe180e4acc4e8af6a447e to your computer and use it in GitHub Desktop.
rename a phoenix 1.3 project
#!/bin/bash
set -e
CURRENT_NAME="CurrentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"
ack -l $CURRENT_NAME | xargs sed -i '' -e "s/$CURRENT_NAME/$NEW_NAME/g"
ack -l $CURRENT_OTP | xargs sed -i '' -e "s/$CURRENT_OTP/$NEW_OTP/g"
# lib folders
mv lib/$CURRENT_OTP lib/$NEW_OTP
mv lib/$CURRENT_OTP.ex lib/$NEW_OTP.ex
mv lib/${CURRENT_OTP}_web lib/${NEW_OTP}_web
mv lib/${CURRENT_OTP}_web.ex lib/${NEW_OTP}_web.ex
# test folders
mv test/$CURRENT_OTP test/$NEW_OTP
mv test/${CURRENT_OTP}_web test/${NEW_OTP}_web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment