From 16637c4f67c8556b72ef82e64fab5784ffd6b3dc 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index f70a7de..b04dbc9 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 = [ 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 PromiseA.all(ps); }).then(function () { return mkdirpAsync(liveDir); }).then(function () {