From 9b895de77c0e767e945d75c75a5869731e678b7c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 13 May 2024 12:56:12 -0600 Subject: [PATCH] fix: skip (instead of fail) when pems.bundle is unavailable --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f70a7de..cf8b4ab 100644 --- a/index.js +++ b/index.js @@ -280,13 +280,17 @@ module.exports.create = function (configs) { var bundleArchive = path.join(archiveDir, 'bundle' + checkpoints + '.pem'); return mkdirpAsync(archiveDir).then(function () { - return PromiseA.all([ + var ps = PromiseA.all([ sfs.writeFileAsync(certArchive, pems.cert, 'ascii') , sfs.writeFileAsync(chainArchive, pems.chain, 'ascii') , sfs.writeFileAsync(fullchainArchive, [ pems.cert, pems.chain ].join('\n'), 'ascii') , sfs.writeFileAsync(privkeyArchive, pems.privkey, 'ascii') - , sfs.writeFileAsync(bundleArchive, pems.bundle, 'ascii') ]); + if (pems.bundle) { + var bundleP = sfs.writeFileAsync(bundleArchive, pems.bundle, 'ascii'); + ps.push(bundleP); + } + return ps; }).then(function () { return mkdirpAsync(liveDir); }).then(function () {