|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|