adopt to latest perf module (#171549)

This commit is contained in:
Sandeep Somavarapu
2023-01-17 22:34:44 +01:00
committed by GitHub
parent 12e6ef9799
commit 664c4ebf6c
3 changed files with 15 additions and 10 deletions

View File

@@ -7,23 +7,25 @@
const path = require('path');
const perf = require('@vscode/vscode-perf');
const minimist = require('minimist');
const VSCODE_FOLDER = path.join(__dirname, '..');
async function main() {
const args = [...process.argv];
/** @type {string | undefined} */
let build = undefined;
if (args.indexOf('--help') === -1 && args.indexOf('-h') === -1) {
// get build arg from args
let buildArgIndex = args.indexOf('--build');
buildArgIndex = buildArgIndex === -1 ? args.indexOf('-b') : buildArgIndex;
if (buildArgIndex === -1) {
args.push('--build');
args.push(getLocalCLIPath());
build = getLocalCLIPath();
} else {
const exePath = args[buildArgIndex + 1];
args.splice(buildArgIndex + 1, 1, getExePath(exePath));
build = getExePath(args[buildArgIndex + 1]);
args.splice(buildArgIndex + 1, 1);
}
args.push('--folder');
@@ -32,7 +34,10 @@ async function main() {
args.push(path.join(VSCODE_FOLDER, 'package.json'));
}
await perf(args);
await perf.run(build ? {
...minimist(args),
build
} : undefined);
}
/**