_From @hoffmanjon on January 6, 2017 12:58_
Ionic version: (check one with "x")
[ ] 1.x
[X] 2.x
I'm submitting a ... (check one with "x")
[ ] bug report
[X] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
This request has two parts:
Expected behavior:
_Copied from original issue: driftyco/ionic#9899_
_From @astec on January 6, 2017 16:5_
Also please add support for sub-directories. E.g. "module1/page1" should generate Page1Page in "pages/module1/page1.ts" rather then Module1Page1Page in "pages/module1-page1.ts"
I echo this sentiment. When I generate new components (or else) using angular-cli, it automatically adds it to the app.module.ts file. Ionic-cli should provide the same behavior.
Any news about this feature ?
I just overwrote a very important file with the command "ionic g provider {nameOfProvider}" It was a dumb mistake, but very frustrating. It could have been avoided with the 2nd expected behavior outlined here. I'm trying to recover it by downloading my app's most recent version on ionic.io / Ionic View. I've contacted [email protected] to see what my options are.
Out of lazyness ive hit the "arrow up" in my command prompt so it will issue the last command,now after checking the file it was totally new, although the overwrited file is not very important to me as of now,a prompt for file duplicate is very important for other projects.
details:
ionic/cli-utils : 1.3.0
cordova cli : 7.0.1
ionic cli : 3.3.0
Generators will be improved. We're aware of the poor UX. In the meantime, we highly recommend using version control such as git.
@dwieeb using git is all fine and dandy, but what i have done before is:
ionic run androidionic generate page test-pageAt this point whatever work I have done is gone and I wouldn't think anyone would commit before running to verify it is working at least once...
I imagine most of the people running into this issue are already using version control.
I'm curious why you've closed the issue? is #1 resolved? are you moving the issue elsewhere?
@goleary Because there are serious architectural problems with our generators. I don't even think it would be _possible_ right now to check if the file exists and prompt back for overwrite confirmation. I see our current generators as a stopgap and will take a serious look at them later, but I don't have time or energy to take a look at this right now.
Here's a placeholder issue: https://github.com/ionic-team/ionic-cli/issues/2407
+1. Just lost work because of this silly overwriting thing. Would love to see this reopened and fixed.
Most helpful comment
I just overwrote a very important file with the command "ionic g provider {nameOfProvider}" It was a dumb mistake, but very frustrating. It could have been avoided with the 2nd expected behavior outlined here. I'm trying to recover it by downloading my app's most recent version on ionic.io / Ionic View. I've contacted [email protected] to see what my options are.