Closed maxnordlund closed 6 years ago
I will look into this. I might add an option to create backups of the relevant files, instead of overwriting them. I would like to keep the default behavior as it is, though, as it works well with new projects.
I am a bit busy at the moment, but hopefully I will find some time to work on this some time this week or next.
Thank you
The latest version (1.1.3) has a backups
option, which is true by default. This means that if a file already exists, a backup of the file will be created.
That's good enough. Does it say so when you run it? Would be nice to know before hand.
I need to update the documentation / wiki for this, but it does print out a message for every file that is created.
Lovely, thanks.
By that I mean it overwrites a bunch of files, which makes it a bit harder to use on an existing project. Instead it would be sweet if it acted like the new phx.gen.context mix task that only appends to the file instead of overwriting.
This may or may not be hard, I'm not sure how to best go about this. Either some sort of string manipulation, but the best would be to actually parse the code, modify the AST, and render it back again. Perhaps one could use macros to great effect here. Or look at how the various code formatters/linters do it.
Anyway, I do love it though. After a bit of manual restoration (while still keeping the important changes) it works very nice.