Merge branch 'dbal' of github.com:designcreateplay/NodeBB into dbal

v1.18.x
Julian Lam 11 years ago
commit 4fd08332cc

@ -5,7 +5,7 @@ var nconf = require('nconf'),
winston = require('winston'); winston = require('winston');
if(!databaseType) { if(!databaseType) {
winston.info('Database type not set! Run npm app --setup'); winston.info('Database type not set! Run node app --setup');
process.exit(); process.exit();
} }

@ -110,7 +110,7 @@ var async = require('async'),
} }
function dbQuestionsSuccess(err, databaseConfig) { function dbQuestionsSuccess(err, databaseConfig) {
if (!config) { if (!databaseConfig) {
return next(new Error('aborted')); return next(new Error('aborted'));
} }
@ -129,9 +129,10 @@ var async = require('async'),
password: databaseConfig['mongo:password'], password: databaseConfig['mongo:password'],
database: databaseConfig['mongo:database'] database: databaseConfig['mongo:database']
}; };
} else {
return next(new Error('unknown database : ' + config.database));
} }
// Add hardcoded values
config.bcrypt_rounds = 12; config.bcrypt_rounds = 12;
config.upload_path = '/public/uploads'; config.upload_path = '/public/uploads';
config.use_port = (config.use_port.slice(0, 1) === 'y') ? true : false; config.use_port = (config.use_port.slice(0, 1) === 'y') ? true : false;
@ -153,10 +154,13 @@ var async = require('async'),
}); });
} }
if(config.database === 'redis') if(config.database === 'redis') {
prompt.get(install.redisQuestions, dbQuestionsSuccess); prompt.get(install.redisQuestions, dbQuestionsSuccess);
else if(config.database === 'mongo') } else if(config.database === 'mongo') {
prompt.get(install.mongoQuestions, dbQuestionsSuccess); prompt.get(install.mongoQuestions, dbQuestionsSuccess);
} else {
return next(new Error('unknown database : ' + config.database));
}
}; };
// prompt prepends "prompt: " to questions, let's clear that. // prompt prepends "prompt: " to questions, let's clear that.

Loading…
Cancel
Save