From b8e6369fbeb6764bb3a00dd1245e7b5be748d22e Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 25 Oct 2019 11:01:34 -0500 Subject: [PATCH] Fix empty --cert not generating self-signed certificate Fixes #1101. --- src/node/cli.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/node/cli.ts b/src/node/cli.ts index d65397f58..0f3e20177 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -101,11 +101,8 @@ const startVscode = async (): Promise => { options.password = await generatePassword(); } - if (!options.certKey && typeof options.certKey !== "undefined") { - throw new Error(`--cert-key cannot be blank`); - } else if (options.certKey && !options.cert) { - throw new Error(`--cert-key was provided but --cert was not`); - } if (!options.cert && typeof options.cert !== "undefined") { + // This is necessary since VS Code filters out empty strings. + if (typeof options.cert === "undefined" && process.argv.indexOf("--cert") !== -1) { const { cert, certKey } = await generateCertificate(); options.cert = cert; options.certKey = certKey;