Skip to content

Commit 58f7f5b

Browse files
committed
Properly fix blank --cert flag
See #1109.
1 parent b8e6369 commit 58f7f5b

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

scripts/vscode.patch

+10-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ index 990755c4f3..06449bb9cb 100644
8787
+ extraBuiltinExtensionPaths: string[];
8888
}
8989
diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts
90-
index 3e48fe4ddd..e0962b8736 100644
90+
index 3e48fe4ddd..2212ff5471 100644
9191
--- a/src/vs/platform/environment/node/argv.ts
9292
+++ b/src/vs/platform/environment/node/argv.ts
9393
@@ -58,6 +58,8 @@ export const OPTIONS: OptionDescriptions<Required<ParsedArgs>> = {
@@ -99,6 +99,15 @@ index 3e48fe4ddd..e0962b8736 100644
9999
'list-extensions': { type: 'boolean', cat: 'e', description: localize('listExtensions', "List the installed extensions.") },
100100
'show-versions': { type: 'boolean', cat: 'e', description: localize('showVersions', "Show versions of installed extensions, when using --list-extension.") },
101101
'category': { type: 'string', cat: 'e', description: localize('category', "Filters installed extensions by provided category, when using --list-extension.") },
102+
@@ -185,7 +187,7 @@ export function parseArgs<T>(args: string[], options: OptionDescriptions<T>, err
103+
delete parsedArgs[o.deprecates];
104+
}
105+
106+
- if (val) {
107+
+ if (typeof val !== 'undefined') {
108+
if (o.type === 'string[]') {
109+
if (val && !Array.isArray(val)) {
110+
val = [val];
102111
diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts
103112
index f7d207009d..5c37b52dab 100644
104113
--- a/src/vs/platform/environment/node/environmentService.ts

src/node/cli.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ const startVscode = async (): Promise<void | void[]> => {
101101
options.password = await generatePassword();
102102
}
103103

104-
// This is necessary since VS Code filters out empty strings.
105-
if (typeof options.cert === "undefined" && process.argv.indexOf("--cert") !== -1) {
104+
if (!options.certKey && typeof options.certKey !== "undefined") {
105+
throw new Error(`--cert-key cannot be blank`);
106+
} else if (options.certKey && !options.cert) {
107+
throw new Error(`--cert-key was provided but --cert was not`);
108+
} if (!options.cert && typeof options.cert !== "undefined") {
106109
const { cert, certKey } = await generateCertificate();
107110
options.cert = cert;
108111
options.certKey = certKey;

0 commit comments

Comments
 (0)