v1.18.x
Julian Lam 11 years ago
parent cbca9a4faf
commit 4f7810090a

@ -7,7 +7,6 @@ var async = require('async'),
questions = {};
// maybe this should go into install/database.js
function success(err, config, callback) {
if (!config) {
return callback(new Error('aborted'));

@ -15,9 +15,10 @@
"test": "mocha ./tests/database.js -t 1000"
},
"dependencies": {
"socket.io": "~0.9.16",
"express": "3.2.0",
"express-namespace": "~0.1.1",
"socket.io": "~0.9.16",
"socket.io-wildcard": "~0.1.1",
"passport": "~0.2.0",
"passport-local": "0.1.6",
"marked": "0.2.8",
@ -26,7 +27,6 @@
"gravatar": "1.0.6",
"nconf": "~0.6.7",
"sitemap": "~0.7.1",
"reds": "~0.2.4",
"winston": "~0.7.2",
"rss": "~0.2.0",
"prompt": "~0.2.11",
@ -36,29 +36,20 @@
"semver": "~2.2.1",
"string": "~1.7.0",
"xregexp": "~2.0.0",
"socket.io-wildcard": "~0.1.1",
"bcryptjs": "~0.7.10",
"less": "~1.6.3",
"daemon": "~1.1.0",
"underscore": "~1.6.0",
"mkdirp": "~0.3.5",
"rimraf": "~2.2.6",
"reds": "~0.2.4",
"npm": "^1.4.6",
"nodebb-plugin-mentions": "~0.4.0",
"nodebb-plugin-markdown": "~0.4.1",
"nodebb-widget-essentials": "~0.0.21",
"nodebb-theme-vanilla": "~0.0.19",
"nodebb-theme-lavender": "~0.0.25",
"nodebb-plugin-soundpack-default": "~0.1.0",
"less": "~1.6.3",
"daemon": "~1.1.0",
"underscore": "~1.6.0",
"mkdirp": "~0.3.5",
"rimraf": "~2.2.6"
},
"optionalDependencies": {
"redis": "0.8.3",
"hiredis": "~0.1.15",
"connect-redis": "1.4.5",
"mongodb": "~1.3.19",
"connect-mongo": "0.4.0",
"levelup": "^0.18.2",
"leveldown": "^0.10.2",
"connect-leveldb": "^0.1.5"
"nodebb-plugin-soundpack-default": "~0.1.0"
},
"devDependencies": {
"mocha": "~1.13.0"

@ -121,7 +121,7 @@ function checkCIFlag(next) {
}
function setupConfig(next) {
var configureDatabases = require('./../install/databases');
var configureDatabases = require('../install/databases');
// prompt prepends "prompt: " to questions, let's clear that.
prompt.start();
@ -195,7 +195,43 @@ function completeConfigSetup(err, config, next) {
return next(err);
}
require('./database').init(next);
setupDatabase(server_conf, next);
});
}
function setupDatabase(server_conf, next) {
var npm = require('npm'),
packages = [];
npm.load({
loglevel: 'silly'
}, function(err) {
if (err) {
next(err);
}
switch(server_conf.database) {
case 'redis':
packages = packages.concat(['redis', 'hiredis', 'connect-redis']);
break;
case 'mongo':
packages = packages.concat(['mongodb', 'connect-mongo']);
break;
case 'level':
packages = packages.concat(['levelup', 'leveldown', 'connect-level']);
break;
}
console.log(packages);
npm.commands.install(packages, function(err) {
if (err) {
return next(err);
}
require('./database').init(next);
});
});
}

Loading…
Cancel
Save