-
-
Save lleger/947f43becef6900527c2d6c5894ca9d2 to your computer and use it in GitHub Desktop.
rename a phoenix 1.4 umbrella
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
CURRENT_NAME="OldName" | |
CURRENT_OTP="old_name" | |
NEW_NAME="NewName" | |
NEW_OTP="new_name" | |
ack -l $CURRENT_NAME --ignore-file=is:rename.sh | xargs sed -i '' -e "s/$CURRENT_NAME/$NEW_NAME/g" | |
ack -l $CURRENT_OTP --ignore-file=is:rename.sh | xargs sed -i '' -e "s/$CURRENT_OTP/$NEW_OTP/g" | |
mv apps/$CURRENT_OTP/lib/$CURRENT_OTP.ex apps/$CURRENT_OTP/lib/$NEW_OTP.ex | |
mv apps/$CURRENT_OTP/lib/$CURRENT_OTP apps/$CURRENT_OTP/lib/$NEW_OTP | |
mv apps/$CURRENT_OTP/test/$CURRENT_OTP apps/$CURRENT_OTP/test/$NEW_OTP | |
mv apps/$CURRENT_OTP apps/$NEW_OTP | |
mv apps/"${CURRENT_OTP}_web"/lib/"${CURRENT_OTP}_web".ex apps/"${CURRENT_OTP}_web"/lib/"${NEW_OTP}_web".ex | |
mv apps/"${CURRENT_OTP}_web"/lib/"${CURRENT_OTP}_web" apps/"${CURRENT_OTP}_web"/lib/"${NEW_OTP}_web" | |
mv apps/"${CURRENT_OTP}_web"/test/"${CURRENT_OTP}_web" apps/"${CURRENT_OTP}_web"/test/"${NEW_OTP}_web" | |
mv apps/"${CURRENT_OTP}_web" apps/"${NEW_OTP}_web" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment