Skip to content

Commit 081a659

Browse files
Leksatsarahetter
andauthored
fix: avoid prompting from a vscode task (#7274)
Co-authored-by: Sarah Etter <sarah.etter@netlify.com>
1 parent 6acb880 commit 081a659

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/edge-functions/editor-helper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { env } from 'process'
1+
import { env, stdin, stdout } from 'process'
22

33
import inquirer from 'inquirer'
44

@@ -12,6 +12,8 @@ export const promptEditorHelper = async ({ NETLIFYDEVLOG, chalk, config, log, re
1212
// terminal, as otherwise we'll show the prompt and wait for a response.
1313
if (env.NODE_ENV === 'test') return
1414

15+
if (!stdin.isTTY || !stdout.isTTY) return
16+
1517
const isVSCode = env.TERM_PROGRAM === 'vscode'
1618
const hasShownPrompt = Boolean(state.get(STATE_PROMPT_PROPERTY))
1719
const hasEdgeFunctions = Boolean(config.edge_functions && config.edge_functions.length !== 0)

0 commit comments

Comments
 (0)