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();
}
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;