Skip to content

Instantly share code, notes, and snippets.

@auser
Forked from nerdyworm/rename.sh
Created December 29, 2016 09:42
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 auser/4bbae33f583fc382823283d599a2e674 to your computer and use it in GitHub Desktop.
Save auser/4bbae33f583fc382823283d599a2e674 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment