Skip to content

Instantly share code, notes, and snippets.

@vrymel
Created September 9, 2017 09:14
Show Gist options
  • Save vrymel/f9950b7a20e572e8a7ef6d727cd897d3 to your computer and use it in GitHub Desktop.
Save vrymel/f9950b7a20e572e8a7ef6d727cd897d3 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
@yagudaev
Copy link

Thank you, that was really helpful.

The only thing that is missing is moving the _web directory. Which I just did manually.

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