Skip to content

Commit

Permalink
Update scripts use of spawnSync to work with newer versions of nodejs (
Browse files Browse the repository at this point in the history
…#12503)

Co-authored-by: Colen Garoutte-Carson <[email protected]>
  • Loading branch information
fearthecowboy and Colengms authored Aug 20, 2024
1 parent cb50bb1 commit 818f7c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Extension/.scripts/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export async function main() {
//verbose(`Installing release version of 'ms-vscode.cpptools'`);
//spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cpptools'], { encoding: 'utf-8', stdio: 'ignore' })
verbose(green('Launch VSCode'));
const ARGS = [...args, ...options.launchArgs.filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir=')), `--extensionDevelopmentPath=${$root}`, ...$args ];
verbose(gray(`${cli}\n ${ [...ARGS ].join('\n ')}`));
const ARGS = [...args, ...options.launchArgs.filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir=')), `--extensionDevelopmentPath=${$root}`, ...$args ].map(each => (each.indexOf(' ') > -1) && (each.indexOf('"') === -1) ? `"${each}"` : each);
const CLI = cli.indexOf(' ') > -1 && cli.indexOf('"') === -1 ? `"${cli}"` : cli;

spawnSync(cli, ARGS, { encoding: 'utf-8', stdio: 'ignore', env: { ...process.env, DONT_PROMPT_WSL_INSTALL:"1" } });
verbose(gray(`${CLI}\n ${ [...ARGS ].join('\n ')}`));

spawnSync(CLI, ARGS, { encoding: 'utf-8', stdio: 'ignore', env: { ...process.env, DONT_PROMPT_WSL_INSTALL:"1" }, shell: true });
}
2 changes: 1 addition & 1 deletion Extension/.scripts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ filterStdio();
async function unitTests() {
await assertAnyFolder('dist/test/unit', `The folder '${$root}/dist/test/unit is missing. You should run ${brightGreen("yarn compile")}\n\n`);
const mocha = await assertAnyFile(["node_modules/.bin/mocha.cmd", "node_modules/.bin/mocha"], `Can't find the mocha testrunner. You might need to run ${brightGreen("yarn install")}\n\n`);
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio:'inherit'});
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio:'inherit', shell: true });
verbose(`\n${green("NOTE:")} If you want to run a scenario test (end-to-end) use ${cmdSwitch('scenario=<NAME>')} \n\n`);
return result.status;
}
Expand Down

0 comments on commit 818f7c6

Please sign in to comment.