|
|
@ -90,6 +90,11 @@ if (nconf.get('setup') || nconf.get('install')) {
|
|
|
|
listPlugins();
|
|
|
|
listPlugins();
|
|
|
|
} else if (nconf.get('build')) {
|
|
|
|
} else if (nconf.get('build')) {
|
|
|
|
require('./src/meta/build').build(nconf.get('build'));
|
|
|
|
require('./src/meta/build').build(nconf.get('build'));
|
|
|
|
|
|
|
|
} else if (nconf.get('events')) {
|
|
|
|
|
|
|
|
async.series([
|
|
|
|
|
|
|
|
async.apply(require('./src/database').init),
|
|
|
|
|
|
|
|
async.apply(require('./src/events').output),
|
|
|
|
|
|
|
|
]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
require('./src/start').start();
|
|
|
|
require('./src/start').start();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -218,6 +223,7 @@ function upgrade() {
|
|
|
|
function activate() {
|
|
|
|
function activate() {
|
|
|
|
var db = require('./src/database');
|
|
|
|
var db = require('./src/database');
|
|
|
|
var plugins = require('./src/plugins');
|
|
|
|
var plugins = require('./src/plugins');
|
|
|
|
|
|
|
|
var events = require('./src/events');
|
|
|
|
var plugin = nconf.get('activate');
|
|
|
|
var plugin = nconf.get('activate');
|
|
|
|
async.waterfall([
|
|
|
|
async.waterfall([
|
|
|
|
function (next) {
|
|
|
|
function (next) {
|
|
|
@ -238,6 +244,12 @@ function activate() {
|
|
|
|
winston.info('Activating plugin `%s`', plugin);
|
|
|
|
winston.info('Activating plugin `%s`', plugin);
|
|
|
|
db.sortedSetAdd('plugins:active', 0, plugin, next);
|
|
|
|
db.sortedSetAdd('plugins:active', 0, plugin, next);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
function (next) {
|
|
|
|
|
|
|
|
events.log({
|
|
|
|
|
|
|
|
type: 'plugin-activate',
|
|
|
|
|
|
|
|
text: plugin,
|
|
|
|
|
|
|
|
}, next);
|
|
|
|
|
|
|
|
},
|
|
|
|
], function (err) {
|
|
|
|
], function (err) {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
winston.error(err.message);
|
|
|
|
winston.error(err.message);
|
|
|
|