From ab67481e99e9135309318339e7be04eda90fdb0d Mon Sep 17 00:00:00 2001 From: Jaap-Jan de Wit Date: Sun, 23 Aug 2020 18:56:25 +0000 Subject: [PATCH] fix eslint errors --- backend/internal/certificate.js | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/backend/internal/certificate.js b/backend/internal/certificate.js index 2dadb343..3508dafb 100644 --- a/backend/internal/certificate.js +++ b/backend/internal/certificate.js @@ -147,22 +147,22 @@ const internalCertificate = { // 4. Request cert return internalCertificate.requestLetsEncryptCloudFlareDnsSsl(certificate, data.meta.cloudflare_token); }) - .then(internalNginx.reload) - .then(() => { - // 6. Re-instate previously disabled hosts - return internalCertificate.enableInUseHosts(in_use_result); - }) - .then(() => { - return certificate; - }) - .catch((err) => { - // In the event of failure, revert things and throw err back - return internalCertificate.enableInUseHosts(in_use_result) - .then(internalNginx.reload) - .then(() => { - throw err; - }); - }); + .then(internalNginx.reload) + .then(() => { + // 6. Re-instate previously disabled hosts + return internalCertificate.enableInUseHosts(in_use_result); + }) + .then(() => { + return certificate; + }) + .catch((err) => { + // In the event of failure, revert things and throw err back + return internalCertificate.enableInUseHosts(in_use_result) + .then(internalNginx.reload) + .then(() => { + throw err; + }); + }); } else { // 3. Generate the LE config return internalNginx.generateLetsEncryptRequestConfig(certificate) @@ -784,7 +784,7 @@ const internalCertificate = { let storeKey = 'echo "dns_cloudflare_api_token = ' + apiToken + '" > ' + tokenLoc; let cmd = - storeKey + " && " + + storeKey + ' && ' + certbot_command + ' certonly --non-interactive ' + '--cert-name "npm-' + certificate.id + '" ' + '--agree-tos ' + @@ -799,9 +799,9 @@ const internalCertificate = { } return utils.exec(cmd).then((result) => { - logger.info(result); - return result; - }); + logger.info(result); + return result; + }); },