nodebb --activate plugin-name

v1.18.x
psychobunny 9 years ago
parent 1cda4e8d9b
commit fbc484d3c9

@ -63,9 +63,7 @@ if (nconf.get('config')) {
}
configExists = fs.existsSync(configFile);
if (!nconf.get('setup') && !nconf.get('install') && !nconf.get('upgrade') && !nconf.get('reset') && configExists) {
start();
} else if (nconf.get('setup') || nconf.get('install')) {
if (nconf.get('setup') || nconf.get('install')) {
setup();
} else if (!configExists) {
require('./install/web').install(nconf.get('port'));
@ -73,6 +71,10 @@ if (!nconf.get('setup') && !nconf.get('install') && !nconf.get('upgrade') && !nc
upgrade();
} else if (nconf.get('reset')) {
reset();
} else if (nconf.get('activate')) {
activate();
} else {
start();
}
function loadConfig() {
@ -280,6 +282,17 @@ function upgrade() {
});
}
function activate() {
loadConfig();
require('./src/database').init(function(err) {
var plugin = nconf.get('activate'),
db = require('./src/database');
db.sortedSetAdd('plugins:active', plugin, 1, start);
});
}
function reset() {
loadConfig();

@ -115,6 +115,16 @@ switch(process.argv[2]) {
});
break;
case 'activate':
var args = process.argv.slice(0);
args.unshift('--activate');
cproc.fork('app.js', args, {
cwd: __dirname,
silent: false
});
break;
case 'upgrade':
async.series([
function(next) {

Loading…
Cancel
Save