Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rename a phoenix project
#!/bin/bash
set -e
CURRENT_NAME="CurentName"
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"
mv lib/$CURRENT_OTP lib/$NEW_OTP
mv lib/$CURRENT_OTP.ex lib/$NEW_OTP.ex
@jonathan-soifer

This comment has been minimized.

Copy link

@jonathan-soifer jonathan-soifer commented Apr 8, 2017

Minor (possibly irrelevant) typo: CURRENT_NAME="CurentName"

Whoever uses this script will replace the names for their own use case but maybe you would like to know 😄

@skanel

This comment has been minimized.

Copy link

@skanel skanel commented Sep 24, 2017

can this apply for phoenix 1.3.0?

@rubysolo

This comment has been minimized.

Copy link

@rubysolo rubysolo commented Oct 5, 2017

For phoenix 1.3, you'll want to make sure that you also rename the lib/*_web directory and the lib/*_web.ex file.

@kumekay

This comment has been minimized.

Copy link

@kumekay kumekay commented Dec 27, 2017

can this apply for phoenix 1.3.0?

Here is a fork updated for Phoenix 1.3
https://gist.github.com/kumekay/8f4c8c0b88152a83c989d45f1fab810a

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