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 = [];