fix: skip (instead of fail) when pems.bundle is unavailable

This commit is contained in:
AJ ONeal 2024-05-13 12:56:12 -06:00
parent c834d1603d
commit 16637c4f67
No known key found for this signature in database
GPG Key ID: F1D692A76F70CF98
1 changed files with 7 additions and 3 deletions

View File

@ -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 () {