-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generators: rollback changes if an error occurs #82
Comments
ENVIRONMENT
OBSERVATION Running the Posts generation example from the tutorial, only some files are generated:
One file already existed from a prior run (=> me not cleaning everything up). The step with "X" (Writing SUGGESTION Possibly an Some form of all-or-nothing generation (with awareness of |
We do have a I've actually got a fix for this specific problem (it will just skip Ideally we want a more interactive |
Additional feedback FWIW. Assuming |
@cannikin Ok to close this one out? |
@thedavidprice This was meant to be a feature/enhancement issue but turned into a bug report. haha I think this IS a feature we want at some point: right now if a generator fails for some reason you'll have half the files created and half not. |
@cannikin do you think the Destroy command covers this feature? It's not 1-to-1, but maybe this feature could leverage Destroy -- e.g. if error occurs it would prompt to run cleanup via Destroy. |
Hmmm, good question. I'm not sure what happens if some of the files don't exist when you run the destroy command, but it would be pretty ironic if then that blew up! But in theory it does know how to undo everything that the generate command did... I can try to test this out at some point but it may be a few days until I get around to it! |
An update on this: the presence of |
Right now if an error occurs while the generators are running anything that was already done (create files, append routes) will be left in place.
We should keep track of all changes that are made and roll them back if an error occurs during a generator.
The text was updated successfully, but these errors were encountered: