You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For our generators, we currently overwrite a path if it already exists. We should fix this so it doesn't happen and show a helpful error message letting them know why.
For some cases (e.g. when we make a parent and a child class), we may want to output (and not overwrite) the parent class but continue on and write the child class.
I'm thinking that we can create Hanami::CLI::Files#create which will raise an error if the path exists and use that everywhere we need to. I guess we won't need an update method, since we use some of the methods on dry-files to update content at a certain place.
# Within Hanami::CLI::Filesdefcreate(path, *content)ifexist?(path)raiseFileAlreadyExistsError.new(path)# this is newelsewrite(path, *content)endend
The text was updated successfully, but these errors were encountered:
For our generators, we currently overwrite a path if it already exists. We should fix this so it doesn't happen and show a helpful error message letting them know why.
For some cases (e.g. when we make a parent and a child class), we may want to output (and not overwrite) the parent class but continue on and write the child class.
I'm thinking that we can create
Hanami::CLI::Files#create
which will raise an error if the path exists and use that everywhere we need to. I guess we won't need anupdate
method, since we use some of the methods on dry-files to update content at a certain place.The text was updated successfully, but these errors were encountered: