Merge pull request #2778 from ahwayakchih/support-more-config-defaults-for-setup

This adds more setup defaults from config.
v1.18.x
Julian Lam 10 years ago
commit 848babcdfa

@ -21,7 +21,7 @@
/*global require, global, process*/ /*global require, global, process*/
var nconf = require('nconf'); var nconf = require('nconf');
nconf.argv().env(); nconf.argv().env('__');
var fs = require('fs'), var fs = require('fs'),
os = require('os'), os = require('os'),

@ -22,12 +22,14 @@
}, },
{ {
name: 'mongo:username', name: 'mongo:username',
description: 'MongoDB username' description: 'MongoDB username',
'default': nconf.get('mongo:username') || ''
}, },
{ {
name: 'mongo:password', name: 'mongo:password',
description: 'Password of your MongoDB database', description: 'Password of your MongoDB database',
hidden: true hidden: true,
before: function(value) { value = value || nconf.get('mongo:password') || ''; return value; }
}, },
{ {
name: "mongo:database", name: "mongo:database",

@ -28,7 +28,8 @@
{ {
name: 'redis:password', name: 'redis:password',
description: 'Password of your Redis database', description: 'Password of your Redis database',
hidden: true hidden: true,
before: function(value) { value = value || nconf.get('redis:password') || ''; return value; }
}, },
{ {
name: "redis:database", name: "redis:database",

@ -47,7 +47,7 @@ questions.main = [
questions.optional = [ questions.optional = [
{ {
name: 'port', name: 'port',
default: 4567 default: nconf.get('port') || 4567
} }
]; ];

Loading…
Cancel
Save