From 0f5eebd9cccfd17f5b7b3ff4436d8c5d4797312e Mon Sep 17 00:00:00 2001 From: Cyrille Date: Thu, 9 May 2019 22:14:51 +0100 Subject: [PATCH] setPaths function. --- lib/certificates/check.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/certificates/check.js b/lib/certificates/check.js index f920aa9..559a336 100644 --- a/lib/certificates/check.js +++ b/lib/certificates/check.js @@ -3,15 +3,19 @@ const s3 = new AWS.S3({ apiVersion: "2006-03-01" }); const pathHelper = require("../pathHelper"); const fileNames = require("../fileNames"); -module.exports.check = (opts, options) => { - const id = opts.certificate && opts.certificate.id || opts.subject; - console.log("certificates.check for", opts.subject); - - let paths = [ +const setPaths = (opts, options, id) => { + return [ pathHelper.certificatesPath(options, id, fileNames.privkey.pem) , pathHelper.certificatesPath(options, id, fileNames.cert) , pathHelper.certificatesPath(options, id, fileNames.chain) ] +}; + +module.exports.check = (opts, options) => { + const id = opts.certificate && opts.certificate.id || opts.subject; + console.log("certificates.check for", opts.subject); + + const paths = setPaths(opts, options, id); var promises = [];