feat(cli): --yes option to accept all questions#826
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #826 +/- ##
==========================================
+ Coverage 83.44% 84.49% +1.05%
==========================================
Files 71 71
Lines 10401 10437 +36
Branches 1314 1347 +33
==========================================
+ Hits 8679 8819 +140
+ Misses 1684 1577 -107
- Partials 38 41 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // In non-interactive mode, always return success (true). | ||
| if (this.nonInteractive) { | ||
| return true; | ||
| } | ||
|
|
There was a problem hiding this comment.
Q. It should return msg.defaultResponse instead of true?
There was a problem hiding this comment.
Yes, we need to return true for isConfirmationPrompt, msg.defaultResponse if there is one, and continue otherwise.
I would also like us to still print the question and answer and indicating that --yes was used.
We should also only do this after the this.skipApprovalStep(msg) check. On the other hand, --yes should make scenarios work where we don't have a TTY or are using concurrency. So we will need to restructure the checks.
Adds a new
--yescli option so that when provided, commands can continue without confirmation. Any confirmation prompts will be accepted. Other user input will use a default value if available. The CLI might still prompt for input in situations where there is no default answer.Fixes #732
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license