MCPcopy
hub / github.com/vitejs/vite / executeNodeScript

Function executeNodeScript

packages/vite/src/node/server/openBrowser.ts:42–59  ·  view source on GitHub ↗
(scriptPath: string, url: string, logger: Logger)

Source from the content-addressed store, hash-verified

40}
41
42function executeNodeScript(scriptPath: string, url: string, logger: Logger) {
43 const extraArgs = process.argv.slice(2)
44 const child = spawn(process.execPath, [scriptPath, ...extraArgs, url], {
45 stdio: 'inherit',
46 })
47 child.on('close', (code) => {
48 if (code !== 0) {
49 logger.error(
50 colors.red(
51 `\nThe script specified as BROWSER environment variable failed.\n\n${colors.cyan(
52 scriptPath,
53 )} exited with code ${code}.`,
54 ),
55 { error: null },
56 )
57 }
58 })
59}
60
61const supportedChromiumBrowsers = [
62 'Google Chrome Canary',

Callers 1

openBrowserFunction · 0.85

Calls 2

onMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected