Skip to content

Instantly share code, notes, and snippets.

@dbernheisel
Last active February 14, 2021 06:58
Show Gist options
  • Select an option

  • Save dbernheisel/cb51c919277f355a5505a87298be79ea to your computer and use it in GitHub Desktop.

Select an option

Save dbernheisel/cb51c919277f355a5505a87298be79ea to your computer and use it in GitHub Desktop.
Rename a Phoenix project
export FROM="petal"
export FROM_MOD="Petal"
export TO="elixir_stream"
export TO_MOD="ElixirStream"
cp -R "$FROM" "$TO"
cd "$TO"
git ls-files -z | xargs -0 perl -p -i -e "s/$FROM/$TO/g; s/$FROM_MOD/$TO_MOD/g;"
mv "lib/${FROM}" "lib/$TO"
mv "lib/${FROM}.ex" "lib/${TO}.ex"
mv "lib/${FROM}_web" "lib/${TO}_web"
mv "lib/${FROM}_web.ex" "lib/${TO}_web.ex"
mv "test/${FROM}_web" "test/${TO}_web"
rm -rfv .git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment