-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Our CLI app allows users to provide prompt answers in multiple ways:
- Some values can be configured via CLI arguments and options, e.g.
name. - It is possible to provide JSON object with values to all prompts via
--configoption. - It is possible to stream a JSON object to
stdin
At the moment, the logic determining when to read data from stdin is based on process.stdin.isTTY flag. Unfortunately, this is often causing confusing behavior.
- When debugging our CLI tool via Visual Studio Code, application's
stdinstream is in non-TTY mode. As a result, CLI uses different way (code path) to prompt for options. - The outcome of our test suite depends on whether the
stdinstream is available and in TTY mode. When running the tests withstdindisabled (e.g. vianpm test < /dev/null), many of the tests fail.
I would like us to improve the logic deciding how to prompt for options and make it more robust, less suspect to different ways how CLI can be legitimately invoked.
Acceptance Criteria
To be added by the team after discussing with @bajtos.
Reactions are currently unavailable