Skip to content

Commit b8fa7f5

Browse files
author
Tajudeen
committed
Fix electronOverride declaration in gulpfile.vscode.js
The previous implementation broke the method chain by inserting the electronOverride declaration in the middle of the pipe chain. This caused a SyntaxError: "Identifier 'electronOverride' has already been declared". Fixed by: - Moving electronOverride declaration before the let result statement - Using const instead of let for electronOverride (linter requirement) - Ensuring the method chain remains intact - Properly declaring variables before they are used in the pipe chain This allows custom Electron repositories to be specified via VSCODE_ELECTRON_REPOSITORY and VSCODE_ELECTRON_TAG environment variables for alternative architectures (riscv64, ppc64le, loong64).
1 parent 0447260 commit b8fa7f5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

build/gulpfile.vscode.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,9 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
369369
all = es.merge(all, shortcut, policyDest);
370370
}
371371

372-
let result = all
373-
.pipe(util.skipDirectories())
374-
.pipe(util.fixWin32DirectoryPermissions())
375-
.pipe(filter(['**', '!**/.github/**'], { dot: true })) // https://github.com/microsoft/vscode/issues/116523
376-
377372
// CORTEXIDE/VSCODIUM: Support custom Electron repositories for alternative architectures
378373
// This allows using VSCODE_ELECTRON_REPOSITORY and VSCODE_ELECTRON_TAG env vars
379-
let electronOverride = {};
374+
const electronOverride = {};
380375
if (process.env.VSCODE_ELECTRON_REPOSITORY) {
381376
electronOverride.repo = process.env.VSCODE_ELECTRON_REPOSITORY;
382377
}
@@ -385,6 +380,10 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
385380
}
386381
const hasElectronOverride = electronOverride.repo || electronOverride.tag;
387382

383+
let result = all
384+
.pipe(util.skipDirectories())
385+
.pipe(util.fixWin32DirectoryPermissions())
386+
.pipe(filter(['**', '!**/.github/**'], { dot: true })) // https://github.com/microsoft/vscode/issues/116523
388387
.pipe(electron({ ...config, ...(hasElectronOverride ? electronOverride : {}), platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false }))
389388
.pipe(filter(['**', '!LICENSE', '!version'], { dot: true }));
390389

0 commit comments

Comments
 (0)