Skip to content
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

How to set No as default in overwriting files: yNaxdh? #196

Closed
easingthemes opened this issue May 3, 2017 · 3 comments
Closed

How to set No as default in overwriting files: yNaxdh? #196

easingthemes opened this issue May 3, 2017 · 3 comments

Comments

@easingthemes
Copy link

How to set No as default in overwriting files:

conflict path/to/file/file.txt
? Overwrite path/to/file/file.txt? (Ynaxdh) 

How to change this to yNaxdh?
Also, how to add all No?

Thanks

@SBoudrias
Copy link
Member

I think x is skip all (so "all no")

The conflict handling is a core part of Yeoman and not customizable by generator authors. Yeoman select Y by default because it is the most likely user choice. I don't think we intend to change this at the moment.

Does this answers all your questions?

@easingthemes
Copy link
Author

easingthemes commented May 3, 2017

Nope, 'x' will abort further process.

And overwrite as default is dangerous, you can easily press Enter, and even not notice it.
Eg, having a generator for some component, if component already exist you can easily overwrite it, which probably is not what you wanted to do.

Plus there is already an option- 'a' All, overwrite this and all others if you are sure that you want to overwrite all.

So I think that default option should be changed to n.

   * The user is presented with the following options:
   *
   *   - `Y` Yes, overwrite
   *   - `n` No, do not overwrite
   *   - `a` All, overwrite this and all others
   *   - `q` Quit, abort
   *   - `d` Diff, show the differences between the old and the new
   *   - `h` Help, show this help

Ps. I've opened a PR for small typo: q Quit, abort --> x Exit, abort
yeoman/generator#1018

@SBoudrias
Copy link
Member

About the two points in this issue:

  1. We won't be changing the default behavior to "no". We think that's a pretty rare case rather than the norm. Plus, using git, it's fairly easy to go back on some changes if they were undesired.
  2. Happy to receive a PR on yeoman/generator to add a "skip all overwrite" option.

I'll close this issue here as there's nothing actionable for generator-generator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants