MCPcopy Create free account
hub / github.com/dotnet/vscode-csharp / spawnNode

Function spawnNode

tasks/spawnNode.ts:9–32  ·  view source on GitHub ↗
(args?: string[], options?: SpawnSyncOptions)

Source from the content-addressed store, hash-verified

7import { nodePath, rootPath } from './projectPaths';
8
9export default async function spawnNode(args?: string[], options?: SpawnSyncOptions) {
10 if (!options) {
11 options = {
12 env: {},
13 stdio: 'inherit',
14 };
15 }
16
17 const optionsWithFullEnvironment: SpawnSyncOptions = {
18 cwd: rootPath,
19 ...options,
20 env: {
21 ...process.env,
22 ...options.env,
23 },
24 stdio: options.stdio ?? 'inherit',
25 };
26
27 console.log(`starting ${nodePath} ${args ? args.join(' ') : ''}`);
28
29 const buffer = spawnSync(nodePath, args, optionsWithFullEnvironment);
30
31 return { code: buffer.status, signal: buffer.signal, stdout: buffer.stdout };
32}

Callers 3

createPackageAsyncFunction · 0.85
generateVsixManifestFunction · 0.85
verifySignatureFunction · 0.85

Calls 1

logMethod · 0.80

Tested by

no test coverage detected