fix: guard interactive prompts on both stdin and stdout TTY
This commit is contained in:
parent
7331cbdea2
commit
2834445067
@ -12,7 +12,7 @@ async function selectOrCancel<TValue extends Readonly<string | boolean | number>
|
|||||||
options: Option<TValue>[]
|
options: Option<TValue>[]
|
||||||
initialValue: TValue
|
initialValue: TValue
|
||||||
}): Promise<TValue | null> {
|
}): Promise<TValue | null> {
|
||||||
if (!process.stdin.isTTY) return null
|
if (!process.stdin.isTTY || !process.stdout.isTTY) return null
|
||||||
|
|
||||||
const value = await p.select<TValue>({
|
const value = await p.select<TValue>({
|
||||||
message: params.message,
|
message: params.message,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user