@ubleipzig/autoconfig
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -60,3 +60,3 @@ /** | ||
boolean: true, | ||
default: true | ||
default: false | ||
}, | ||
@@ -127,2 +127,3 @@ 'skip-config': { | ||
dbName: hashId || dbName, | ||
autoDb: argv.hashId, | ||
dbServer: argv.dbServer, | ||
@@ -129,0 +130,0 @@ args: argv.vf || {}, |
@@ -291,2 +291,3 @@ /** | ||
function mergeRuntimeConfigs(targetFiles) { | ||
const defaults = { | ||
@@ -308,2 +309,10 @@ 'config.ini': { | ||
const overrides = {}; | ||
if (options.autoDb) { | ||
overrides['config.ini'] = { | ||
Database: defaults['config.ini'].Database | ||
}; | ||
} | ||
const envVars = nconf.env({ | ||
@@ -334,3 +343,3 @@ parseValues: true, | ||
} else { | ||
target[prop] = source[prop]; | ||
target[prop] = JSON.parse(JSON.stringify(source[prop])); | ||
} | ||
@@ -343,3 +352,3 @@ } | ||
// the order of precedence (left-to-right) | ||
var result = [args, envVars, targetFiles, settings, defaults].reduceRight(deepExtend, {}); | ||
var result = [args, envVars, overrides, targetFiles, settings, defaults].reduceRight(deepExtend, {}); | ||
return result; | ||
@@ -346,0 +355,0 @@ }); |
@@ -56,2 +56,3 @@ /** | ||
try { | ||
dsn = dsn.replace(/^["']+|["']+$/gm,''); | ||
var dbCredentials = url.parse(dsn, true); | ||
@@ -58,0 +59,0 @@ |
{ | ||
"name": "@ubleipzig/autoconfig", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "generates config for deployed instances", | ||
@@ -5,0 +5,0 @@ "scripts": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
78216
1190
3