felangel / mason

Tools which allow developers to create and consume reusable templates called bricks.

Home Page:https://docs.brickhub.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

bryanoltman opened this issue · comments

Description

We're seeing users accidentally enter input other than 'y' or 'n' to a confirm prompt that follows a long build step (see shorebirdtech/shorebird#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.