felangel / felangel/mason

fix: allow `confirm` to only accept 'y' or 'n' as input

Open
#1,202 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Dart
Stars
1.1k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

**Description**

We're seeing users accidentally enter input other than 'y' or 'n' to a `confirm` prompt that follows a long build step (see https://github.com/shorebirdtech/shorebird/issues/1572). It would be a nice guardrail to only accept these inputs and re-display the prompt if we detect input that is not 'y' or 'n'. It would probably make sense to make this behavior optional and to not change the default behavior of `confirm`, maybe by adding an `abortOnUnrecognizedInput` argument to `confirm` that defaults to `true`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.