There is not a command for renaming a project. I have however had to do so a couple times in the past, and in general global find and replace works really rather well. Just also move any directories named paper and you’re done.
A global find+replace works a lot better in Elixir than in most OOP-languages, because you always refer to a certain piece of code the same way: ModuleName.function_name. And structs use the ModuleName as well.
In OOP-languages, you can only hope that some object isn’t referred to under a different name.
@jaysoifer: you forgot about mv command for tests
Also you need to be careful using grep (no preview of changes), because some simple names could be also in other files like assets. Better way is to exclude some folders - just to be sure.
I suggest to use kfilereplace if you are using KDE/Plasma 5, because you can preview what files will be modified.
Great library! Worked out great, the only was with it also change the DB name on dev.exs/text.exs etc which I had to fix manually but besides that - works great!
While I do love elixir, it’s the wrong tool for this job. I’m replying to the topic so the next time I google how to rename a project, I’ll find this code here ready to copy and paste.
Now, you might notice this code is pretty #^@!. I didn’t write it. I though it would be fun to see how well AI could do a pretty simple awk/sed/mv/bash script. And 3 hours later I realize:
Reading the man page for awk/sed/find/etc is faster than asking AI to do it
I have zero fear that Skynet will kill all humans. It would bring nerf guns to the fight at best.
I have 99.9% fear that some programmer will ask AI to write the login page for my bank, or worse.
But in AI’s defense:
I have written worse code than the following
it does appear to have worked.
It comments more than I do
It spells and talks the English much better than I
Warning: It will rename the DB in config/dev.ex too.