Archived
1
0

Fix empty --cert not generating self-signed certificate

Fixes #1101.
This commit is contained in:
Asher 2019-10-25 11:01:34 -05:00
parent d81d5f499f
commit b8e6369fbe
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -101,11 +101,8 @@ const startVscode = async (): Promise<void | void[]> => {
options.password = await generatePassword(); options.password = await generatePassword();
} }
if (!options.certKey && typeof options.certKey !== "undefined") { // This is necessary since VS Code filters out empty strings.
throw new Error(`--cert-key cannot be blank`); if (typeof options.cert === "undefined" && process.argv.indexOf("--cert") !== -1) {
} else if (options.certKey && !options.cert) {
throw new Error(`--cert-key was provided but --cert was not`);
} if (!options.cert && typeof options.cert !== "undefined") {
const { cert, certKey } = await generateCertificate(); const { cert, certKey } = await generateCertificate();
options.cert = cert; options.cert = cert;
options.certKey = certKey; options.certKey = certKey;