Skip to content

Commit 3ff83ed

Browse files
committed
Ensure VS Code dependencies and built-in extensions exist
Fixes #1087.
1 parent f133b00 commit 3ff83ed

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/build.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,28 @@ class Builder {
158158
});
159159

160160
// Download and prepare VS Code if necessary (should be cached by CI).
161-
const exists = fs.existsSync(vscodeSourcePath);
162-
if (exists) {
163-
this.log("Using existing VS Code directory");
161+
if (fs.existsSync(vscodeSourcePath)) {
162+
this.log("Using existing VS Code clone");
164163
} else {
165164
await this.task("Cloning VS Code", () => {
166165
return util.promisify(cp.exec)(
167166
"git clone https://github.com/microsoft/vscode"
168167
+ ` --quiet --branch "${vscodeVersion}"`
169168
+ ` --single-branch --depth=1 "${vscodeSourcePath}"`);
170169
});
170+
}
171171

172+
if (fs.existsSync(path.join(vscodeSourcePath, "node_modules"))) {
173+
this.log("Using existing VS Code node_modules");
174+
} else {
172175
await this.task("Installing VS Code dependencies", () => {
173176
return util.promisify(cp.exec)("yarn", { cwd: vscodeSourcePath });
174177
});
178+
}
175179

180+
if (fs.existsSync(path.join(vscodeSourcePath, ".build/extensions"))) {
181+
this.log("Using existing built-in-extensions");
182+
} else {
176183
await this.task("Building default extensions", () => {
177184
return util.promisify(cp.exec)(
178185
"yarn gulp compile-extensions-build --max-old-space-size=32384",

0 commit comments

Comments
 (0)