Generator with existing entities
Hi,
first off; i'm an idiot.
I generated a file, wrote the code, wanted to start the serve job and in a reflex I did arrow up+ enter in my command prompt.
But i forgot i didnt ionic serve after generating. So it regenerated the page, overwriting the code I just wrote. Is there a possibility the generator checks whether the generate command will overwrite existing files so it can ask for a confirmation?
Hey thanks for the issue. I think this is definitely a good idea, for the exact situation you encountered. On Fri, Apr 29, 2016 at 8:08 AM Max Keyner [email protected] wrote:
Hi,
first off; i'm an idiot.
I generated a file, wrote the code, wanted to start the serve job and in a reflex I did arrow up+ enter in my command prompt.
But i forgot i didnt ionic serve after generating. So it regenerated the page, overwriting the code I just wrote. Is there a possibility the generator checks whether the generate command will overwrite existing files so it can ask for a confirmation?
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/driftyco/ionic-cli/issues/968
D'oh! I just did this exact same thing.
Seems like this would be a super simple fix that would prevent people like myself & max from banging our heads on tables in the future.
closed because why....? has this been fixed?
Huh.. I must've closed the tab before writing a comment. Sorry about that.
We won't be adding this functionality for v3. We're only putting critical fixes into @ionic/app-scripts. That's why I closed this issue.
If you like I can keep the issue open for v4, but for v4 the Ionic CLI uses the Angular CLI to run schematics that generate app features. The feature request would have to be made in the Angular CLI repo, because it would be for ng generate.
I'm pretty sure angular-cli already does this (at least for the last version I used of it that was the case)
Hmm.. I haven't seen that. Is that new for Angular CLI 6.1.0? We'll need to do something in the Ionic CLI to properly handle stdin/stdout of the process.
IIRC this has been the effect for some time.
Oops, sorry. I thought we were talking about the original feature request:
Is there a possibility the generator checks whether the generate command will overwrite existing files so it can ask for a confirmation?
I think the error message is good, though. 👍