From b25821ed8a553a4e4d72bfe6facddd5d24953c84 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 9 Aug 2016 22:07:55 -0400 Subject: [PATCH] overwrite falsey values --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 003473c..2213b2b 100644 --- a/index.js +++ b/index.js @@ -111,7 +111,7 @@ var defaults = { return (copy.server || '').replace('https://', '').replace(/(\/)$/, '').replace(/\//g, path.sep); } -, privkeyPath: [ ':configDir', 'live', ':hostname', 'privkey.pem' ].join(path.sep) +, privkeyPath: ':configDir/live/:hostname/privkey.pem'.split(/\//).join(path.sep) , fullchainPath: [ ':configDir', 'live', ':hostname', 'fullchain.pem' ].join(path.sep) , certPath: [ ':configDir', 'live', ':hostname', 'cert.pem' ].join(path.sep) , chainPath: [ ':configDir', 'live', ':hostname', 'chain.pem' ].join(path.sep) @@ -132,8 +132,9 @@ module.exports.create = function (configs) { if (!configs.domainKeyPath) { configs.domainKeyPath = configs.privkeyPath || defaults.privkeyPath; } + Object.keys(defaults).forEach(function (key) { - if (!(key in configs)) { + if (!configs[key]) { configs[key] = defaults[key]; } });