What's going on?
Accidentally re-ran an ignite generate container command. If there's a container already there with that name, it overwrites the file.
Yes, it was too long between commits. Too long between TimeMachine backups, etc. No I wasn't paying enough attention to what I did in Terminal, etc., etc., etc.
Steps to reproduce
ignite generate container MyCoolNewContainer
Now go edit the container file.
ignite generate container MyCoolNewContainer
You'll find the boilerplate is now in the file.
Suggestion:
Can we get an "Are you sure" if the file name already exists? Or maybe copy the files to FileName-orig.js?
Ouch! That hurts.

We currently rely on the app developer to add an askToOverwrite parameter to their ignite/ignite.json config file.
https://github.com/infinitered/ignite/blob/master/src/extensions/ignite/copyBatch.js#L31
Perhaps we should default to true instead, here?
Important: If we do decide to default to true, then you can't just change the false to a true on that line I linked to, there. You'd need to verify that it is undefined and, if so, then set it to true.
const askToOverwrite = (config.askToOverwrite !== undefined) ? config.askToOverwrite : true
Additionally, you might need to update our integration tests so they don't get hung up on this during CI builds.
@GantMan @skellock Any thoughts on that?
I've got a very good commit workflow, this typically couldn't arrive to me BUT, I'm sure a default with askToOverwrite is the way to do it.
It seems so much probable to be in the "Im going to make a mistake" situation rather than "Im wiping again my file".
The overwrite is something I'm going to use because I'm writing a new generator, but in most cases, I'm sure no one wants to overwrite his file.
The intention was to be true by default.
We should add askToOverride: true in the boilerplate.
You can add askToOverride: true to your .ignite/ignite.json file if you already have a project on the go.
So, just to confirm, I should have something like this?
{
"createdWith": "2.0.0",
"examples": "classic",
"navigation": "react-navigation",
"askToOverride": true,
"generators": {
"component": "ignite-ir-boilerplate",
"container": "ignite-ir-boilerplate",
"listview": "ignite-ir-boilerplate",
"redux": "ignite-ir-boilerplate",
"saga": "ignite-ir-boilerplate",
"screen": "ignite-ir-boilerplate"
}
}
@dustinromey Yes, exactly. (Sorry about the late response here). We should probably default to true like you have it. Would you want to do a PR to the boilerplate here?
Done! https://github.com/infinitered/ignite-ir-boilerplate/pull/121
Hope that fits the bill. I'm mostly a solo coder so not intimately familiar with all the git-foo and good manners.
Thanks for a great project. Its helped me not only advance my project, but also really grasp RN, redux, redux-sagas, and a whole bunch of other tech. I can't praise you guys enough for sharing it so widely and readily.
Pull request was merged. Seems like this issue can be closed.
@dustinromey Awesome, thanks for the kind words and for contributing!
Most helpful comment
Done! https://github.com/infinitered/ignite-ir-boilerplate/pull/121
Hope that fits the bill. I'm mostly a solo coder so not intimately familiar with all the git-foo and good manners.
Thanks for a great project. Its helped me not only advance my project, but also really grasp RN, redux, redux-sagas, and a whole bunch of other tech. I can't praise you guys enough for sharing it so widely and readily.