From 65c3c3d6a0df5e841140bb7a67bf0ef54eb9bbfa Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Wed, 7 May 2025 15:38:22 +0400 Subject: [PATCH] fix: avoid prompting from a vscode task --- src/lib/edge-functions/editor-helper.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/edge-functions/editor-helper.ts b/src/lib/edge-functions/editor-helper.ts index e656000931a..eac4c7810c8 100644 --- a/src/lib/edge-functions/editor-helper.ts +++ b/src/lib/edge-functions/editor-helper.ts @@ -1,4 +1,4 @@ -import { env } from 'process' +import { env, stdin, stdout } from 'process' import inquirer from 'inquirer' @@ -12,6 +12,8 @@ export const promptEditorHelper = async ({ NETLIFYDEVLOG, chalk, config, log, re // terminal, as otherwise we'll show the prompt and wait for a response. if (env.NODE_ENV === 'test') return + if (!stdin.isTTY || !stdout.isTTY) return + const isVSCode = env.TERM_PROGRAM === 'vscode' const hasShownPrompt = Boolean(state.get(STATE_PROMPT_PROPERTY)) const hasEdgeFunctions = Boolean(config.edge_functions && config.edge_functions.length !== 0)