overwrite falsey values
This commit is contained in:
parent
102ffdbe5f
commit
b25821ed8a
5
index.js
5
index.js
|
@ -111,7 +111,7 @@ var defaults = {
|
||||||
return (copy.server || '').replace('https://', '').replace(/(\/)$/, '').replace(/\//g, path.sep);
|
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)
|
, fullchainPath: [ ':configDir', 'live', ':hostname', 'fullchain.pem' ].join(path.sep)
|
||||||
, certPath: [ ':configDir', 'live', ':hostname', 'cert.pem' ].join(path.sep)
|
, certPath: [ ':configDir', 'live', ':hostname', 'cert.pem' ].join(path.sep)
|
||||||
, chainPath: [ ':configDir', 'live', ':hostname', 'chain.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) {
|
if (!configs.domainKeyPath) {
|
||||||
configs.domainKeyPath = configs.privkeyPath || defaults.privkeyPath;
|
configs.domainKeyPath = configs.privkeyPath || defaults.privkeyPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(defaults).forEach(function (key) {
|
Object.keys(defaults).forEach(function (key) {
|
||||||
if (!(key in configs)) {
|
if (!configs[key]) {
|
||||||
configs[key] = defaults[key];
|
configs[key] = defaults[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue