Skip to content

Commit b29ad46

Browse files
author
ktechmidas
committed
fix: use single quotes and preserve ctx values in merge
1 parent aa05e3a commit b29ad46

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/dashmate/src/doctor/analyse/analyseConfigFactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ and revoke the previous certificate in the ZeroSSL dashboard`,
130130
},
131131
// Let's Encrypt validation errors
132132
[LETSENCRYPT_ERRORS.EMAIL_IS_NOT_SET]: {
133-
description: "Let's Encrypt email is not set.",
133+
description: 'Let\'s Encrypt email is not set.',
134134
solution: chalk`Please update your configuration with {bold.cyanBright dashmate config set platform.gateway.ssl.providerConfigs.letsencrypt.email [EMAIL]}`,
135135
},
136136
[LETSENCRYPT_ERRORS.EXTERNAL_IP_IS_NOT_SET]: {
137137
description: 'External IP is not set.',
138138
solution: chalk`Please update your configuration to include your external IP using {bold.cyanBright dashmate config set externalIp [IP]}`,
139139
},
140140
[LETSENCRYPT_ERRORS.CERTIFICATE_NOT_FOUND]: {
141-
description: "Let's Encrypt certificate is not configured",
141+
description: 'Let\'s Encrypt certificate is not configured',
142142
solution: chalk`Please run {bold.cyanBright dashmate ssl obtain --provider=letsencrypt} to get a new certificate`,
143143
},
144144
[LETSENCRYPT_ERRORS.PRIVATE_KEY_NOT_FOUND]: {

packages/dashmate/src/listr/tasks/ssl/letsencrypt/obtainLetsEncryptCertificateTaskFactory.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ export default function obtainLetsEncryptCertificateTaskFactory(
7777
const { error, data } = await validateLetsEncryptCertificate(config, expirationDays);
7878

7979
// Merge validation data (but don't overwrite already-set values)
80-
Object.assign(ctx, data);
80+
Object.keys(data).forEach((key) => {
81+
if (ctx[key] === undefined) {
82+
ctx[key] = data[key];
83+
}
84+
});
8185

8286
switch (error) {
8387
case undefined:

0 commit comments

Comments
 (0)