Skip to content

Commit d15c1f2

Browse files
committed
Use existing spawnNode function
1 parent 5f1bc05 commit d15c1f2

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

tasks/spawnNode.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default async function spawnNode(args?: string[], options?: SpawnSyncOpti
1010
if (!options) {
1111
options = {
1212
env: {},
13+
stdio: 'inherit',
1314
};
1415
}
1516

@@ -20,31 +21,7 @@ export default async function spawnNode(args?: string[], options?: SpawnSyncOpti
2021
...process.env,
2122
...options.env,
2223
},
23-
stdio: 'inherit',
24-
};
25-
26-
console.log(`starting ${nodePath} ${args ? args.join(' ') : ''}`);
27-
28-
const buffer = spawnSync(nodePath, args, optionsWithFullEnvironment);
29-
30-
return { code: buffer.status, signal: buffer.signal, stdout: buffer.stdout };
31-
}
32-
33-
export async function spawnNodeWithOutput(args?: string[], options?: SpawnSyncOptions) {
34-
if (!options) {
35-
options = {
36-
env: {},
37-
};
38-
}
39-
40-
const optionsWithFullEnvironment: SpawnSyncOptions = {
41-
cwd: rootPath,
42-
...options,
43-
env: {
44-
...process.env,
45-
...options.env,
46-
},
47-
stdio: 'pipe',
24+
stdio: options.stdio ?? 'inherit',
4825
};
4926

5027
console.log(`starting ${nodePath} ${args ? args.join(' ') : ''}`);

tasks/vsceTasks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as path from 'path';
77
import * as util from '../src/common';
88
import * as fs from 'fs';
9-
import spawnNode, { spawnNodeWithOutput } from '../tasks/spawnNode';
9+
import spawnNode from '../tasks/spawnNode';
1010
import { vscePath } from './projectPaths';
1111

1212
/// Packaging (VSIX) Tasks
@@ -104,7 +104,7 @@ export async function verifySignature(vsixPath: string) {
104104
vsceArgs.push('--signaturePath');
105105
vsceArgs.push(path.join(outputFolder, `${vsixNameWithoutExtension}.signature.p7s`));
106106

107-
const spawnResult = await spawnNodeWithOutput(vsceArgs);
107+
const spawnResult = await spawnNode(vsceArgs, { stdio: 'pipe' });
108108
if (spawnResult.code != 0) {
109109
throw new Error(`'${vsceArgs.join(' ')}' failed with code ${spawnResult.code}.`);
110110
} else if (spawnResult.stdout != 'Signature verification result: Success') {

0 commit comments

Comments
 (0)