MCPcopy Create free account
hub / github.com/dataform-co/dataform / interactiveQuestion

Function interactiveQuestion

cli/console.ts:56–67  ·  view source on GitHub ↗
(questionText: string)

Source from the content-addressed store, hash-verified

54 * @returns Users's input or test input.
55 */
56export function interactiveQuestion(questionText: string): string {
57 // If running in a non-TTY environment and test inputs are provided
58 if (!process.stdin.isTTY && process.env.DATAFORM_CLI_TEST_INPUTS !== undefined) {
59 const testInput = getTestInput(questionText);
60 print(`${questionText} ${testInput}\n`); // Echo the test input for clarity in logs
61 return testInput;
62 }
63
64 // If running in TTY environment or if testInputs are not available in non-TTY
65 print(`${questionText} `);
66 return readlineSync.question("");
67}
68
69/**
70 * Helper function to enable testing interactive CLI. Retrieves testInput from

Callers 1

promptForIcebergConfigFunction · 0.90

Calls 2

getTestInputFunction · 0.85
printFunction · 0.70

Tested by

no test coverage detected