mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 02:14:06 +00:00
Speed up update-xterm script by combining module installs
This commit is contained in:
parent
c343e8600a
commit
d7a08bd542
|
@ -62,27 +62,36 @@ async function update() {
|
|||
|
||||
const pkg = require(path.join(vscodeDir, 'package.json'));
|
||||
|
||||
const modulesWithVersion = [];
|
||||
for (const m of moduleNames) {
|
||||
const moduleWithVersion = `${m}@${latestVersions[m]}`;
|
||||
if (pkg.dependencies[m] === latestVersions[m]) {
|
||||
console.log(`Skipping ${moduleWithVersion}, already up to date`);
|
||||
continue;
|
||||
}
|
||||
modulesWithVersion.push(moduleWithVersion);
|
||||
}
|
||||
|
||||
if (modulesWithVersion.length > 0) {
|
||||
for (const cwd of [vscodeDir, path.join(vscodeDir, 'remote'), path.join(vscodeDir, 'remote/web')]) {
|
||||
console.log(`${path.join(cwd, 'package.json')}: Updating ${moduleWithVersion}`);
|
||||
cp.execSync(`yarn add ${moduleWithVersion}`, { cwd });
|
||||
console.log(`${path.join(cwd, 'package.json')}: Updating\n ${modulesWithVersion.join('\n ')}`);
|
||||
cp.execSync(`yarn add ${modulesWithVersion.join(' ')}`, { cwd });
|
||||
}
|
||||
}
|
||||
|
||||
const backendOnlyModulesWithVersion = [];
|
||||
for (const m of backendOnlyModuleNames) {
|
||||
const moduleWithVersion = `${m}@${latestVersions[m]}`;
|
||||
if (pkg.dependencies[m] === latestVersions[m]) {
|
||||
console.log(`Skipping ${moduleWithVersion}, already up to date`);
|
||||
continue;
|
||||
}
|
||||
backendOnlyModulesWithVersion.push(moduleWithVersion);
|
||||
}
|
||||
if (backendOnlyModulesWithVersion.length > 0) {
|
||||
for (const cwd of [vscodeDir, path.join(vscodeDir, 'remote')]) {
|
||||
console.log(`${path.join(cwd, 'package.json')}: Updating ${moduleWithVersion}`);
|
||||
cp.execSync(`yarn add ${moduleWithVersion}`, { cwd });
|
||||
console.log(`${path.join(cwd, 'package.json')}: Updating\n ${backendOnlyModulesWithVersion.join('\n ')}`);
|
||||
cp.execSync(`yarn add ${backendOnlyModulesWithVersion.join(' ')}`, { cwd });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue