Skip to content

Instantly share code, notes, and snippets.

@stjhimy
Forked from vrymel/rename_phoenix_project.sh
Created July 4, 2023 17:07
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 stjhimy/4672b60994bfadbfd8046544258005f1 to your computer and use it in GitHub Desktop.
Save stjhimy/4672b60994bfadbfd8046544258005f1 to your computer and use it in GitHub Desktop.
Command steps to rename a Phoenix project
# tested on macOS 10.12.4
# based on https://elixirforum.com/t/how-to-change-a-phoenix-project-name-smoothly/1217/6
# replace values as necessary
current_otp="hello_phoenix"
current_name="HelloPhoenix"
new_otp=""
new_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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment