mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
finished up executable rewrite, and prettified reset script output
This commit is contained in:
34
app.js
34
app.js
@@ -29,6 +29,7 @@ var fs = require('fs'),
|
||||
async = require('async'),
|
||||
semver = require('semver'),
|
||||
winston = require('winston'),
|
||||
colors = require('colors'),
|
||||
path = require('path'),
|
||||
pkg = require('./package.json'),
|
||||
utils = require('./public/src/utils.js');
|
||||
@@ -274,17 +275,19 @@ function reset() {
|
||||
process.exit();
|
||||
}
|
||||
|
||||
if (nconf.get('theme')) {
|
||||
if (nconf.get('t')) {
|
||||
resetThemes();
|
||||
} else if (nconf.get('plugin')) {
|
||||
resetPlugin(nconf.get('plugin'));
|
||||
} else if (nconf.get('plugins')) {
|
||||
resetPlugins();
|
||||
} else if (nconf.get('widgets')) {
|
||||
} else if (nconf.get('p')) {
|
||||
if (nconf.get('p') === true) {
|
||||
resetPlugins();
|
||||
} else {
|
||||
resetPlugin(nconf.get('p'));
|
||||
}
|
||||
} else if (nconf.get('w')) {
|
||||
resetWidgets();
|
||||
} else if (nconf.get('settings')) {
|
||||
} else if (nconf.get('s')) {
|
||||
resetSettings();
|
||||
} else if (nconf.get('all')) {
|
||||
} else if (nconf.get('a')) {
|
||||
require('async').series([resetWidgets, resetThemes, resetPlugins, resetSettings], function(err) {
|
||||
if (!err) {
|
||||
winston.info('[reset] Reset complete.');
|
||||
@@ -294,10 +297,17 @@ function reset() {
|
||||
process.exit();
|
||||
});
|
||||
} else {
|
||||
winston.warn('[reset] Nothing reset.');
|
||||
winston.info('Use ./nodebb reset {theme|plugins|widgets|settings|all}');
|
||||
winston.info(' or');
|
||||
winston.info('Use ./nodebb reset plugin="nodebb-plugin-pluginName"');
|
||||
process.stdout.write('\nNodeBB Reset\n'.bold);
|
||||
process.stdout.write('No arguments passed in, so nothing was reset.\n\n'.yellow);
|
||||
process.stdout.write('Use ./nodebb reset ' + '{-t|-p|-w|-s|-a}\n'.red);
|
||||
process.stdout.write(' -t\tthemes\n');
|
||||
process.stdout.write(' -p\tplugins\n');
|
||||
process.stdout.write(' -w\twidgets\n');
|
||||
process.stdout.write(' -s\tsettings\n');
|
||||
process.stdout.write(' -a\tall of the above\n');
|
||||
|
||||
process.stdout.write('\nPlugin reset flag (-p) can take a single argument\n');
|
||||
process.stdout.write(' e.g. ./nodebb reset -p nodebb-plugin-mentions\n');
|
||||
process.exit();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user