mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
./nodebb plugins for a list of plugins activated
This commit is contained in:
13
app.js
13
app.js
@@ -76,6 +76,8 @@ if (nconf.get('setup') || nconf.get('install')) {
|
|||||||
require('./src/reset').reset();
|
require('./src/reset').reset();
|
||||||
} else if (nconf.get('activate')) {
|
} else if (nconf.get('activate')) {
|
||||||
activate();
|
activate();
|
||||||
|
} else if (nconf.get('plugins')) {
|
||||||
|
listPlugins();
|
||||||
} else {
|
} else {
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
@@ -286,6 +288,17 @@ function activate() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function listPlugins() {
|
||||||
|
require('./src/database').init(function(err) {
|
||||||
|
var db = require('./src/database');
|
||||||
|
|
||||||
|
db.getSortedSetRange('plugins:active', 0, -1, function(err, plugins) {
|
||||||
|
winston.info('Active plugins: \n\t - ' + plugins.join('\n\t - '));
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function shutdown(code) {
|
function shutdown(code) {
|
||||||
winston.info('[app] Shutdown (SIGTERM/SIGINT) Initialised.');
|
winston.info('[app] Shutdown (SIGTERM/SIGINT) Initialised.');
|
||||||
|
|||||||
25
nodebb
25
nodebb
@@ -23,6 +23,13 @@ var getRunningPid = function(callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function fork(args) {
|
||||||
|
cproc.fork('app.js', args, {
|
||||||
|
cwd: __dirname,
|
||||||
|
silent: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
switch(process.argv[2]) {
|
switch(process.argv[2]) {
|
||||||
case 'status':
|
case 'status':
|
||||||
getRunningPid(function(err, pid) {
|
getRunningPid(function(err, pid) {
|
||||||
@@ -107,21 +114,19 @@ switch(process.argv[2]) {
|
|||||||
case 'reset':
|
case 'reset':
|
||||||
var args = process.argv.slice(0);
|
var args = process.argv.slice(0);
|
||||||
args.unshift('--reset');
|
args.unshift('--reset');
|
||||||
|
fork(args);
|
||||||
cproc.fork('app.js', args, {
|
|
||||||
cwd: __dirname,
|
|
||||||
silent: false
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'activate':
|
case 'activate':
|
||||||
var args = process.argv.slice(0);
|
var args = process.argv.slice(0);
|
||||||
args.unshift('--activate');
|
args.unshift('--activate');
|
||||||
|
fork(args);
|
||||||
|
break;
|
||||||
|
|
||||||
cproc.fork('app.js', args, {
|
case 'plugins':
|
||||||
cwd: __dirname,
|
var args = process.argv.slice(0);
|
||||||
silent: false
|
args.unshift('--plugins');
|
||||||
});
|
fork(args);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'upgrade':
|
case 'upgrade':
|
||||||
@@ -165,6 +170,8 @@ switch(process.argv[2]) {
|
|||||||
process.stdout.write('\t' + 'log'.yellow + '\tOpens the logging interface (useful for debugging)\n');
|
process.stdout.write('\t' + 'log'.yellow + '\tOpens the logging interface (useful for debugging)\n');
|
||||||
process.stdout.write('\t' + 'setup'.yellow + '\tRuns the NodeBB setup script\n');
|
process.stdout.write('\t' + 'setup'.yellow + '\tRuns the NodeBB setup script\n');
|
||||||
process.stdout.write('\t' + 'reset'.yellow + '\tDisables all plugins, restores the default theme.\n');
|
process.stdout.write('\t' + 'reset'.yellow + '\tDisables all plugins, restores the default theme.\n');
|
||||||
|
process.stdout.write('\t' + 'activate'.yellow + '\tActivate a plugin on start up.\n');
|
||||||
|
process.stdout.write('\t' + 'plugins'.yellow + '\tList all plugins that have been installed.\n');
|
||||||
process.stdout.write('\t' + 'upgrade'.yellow + '\tRun NodeBB upgrade scripts, ensure packages are up-to-date\n');
|
process.stdout.write('\t' + 'upgrade'.yellow + '\tRun NodeBB upgrade scripts, ensure packages are up-to-date\n');
|
||||||
process.stdout.write('\t' + 'dev'.yellow + '\tStart NodeBB in interactive development mode\n');
|
process.stdout.write('\t' + 'dev'.yellow + '\tStart NodeBB in interactive development mode\n');
|
||||||
process.stdout.write('\t' + 'watch'.yellow + '\tStart NodeBB in development mode and watch for changes\n');
|
process.stdout.write('\t' + 'watch'.yellow + '\tStart NodeBB in development mode and watch for changes\n');
|
||||||
|
|||||||
Reference in New Issue
Block a user