v1.18.x
psychobunny 11 years ago
parent 4e71c8328c
commit 42c9185c7d

@ -81,14 +81,25 @@ if (!nconf.get('help') && !nconf.get('setup') && !nconf.get('install') && !nconf
resetThemes(); resetThemes();
} else if (nconf.get('plugins')) { } else if (nconf.get('plugins')) {
resetPlugins(); resetPlugins();
} else if (nconf.get('widgets')) {
resetWidgets();
} else if (nconf.get('all')) { } else if (nconf.get('all')) {
require('async').parallel([resetThemes, resetPlugins], function(err) { resetWidgets(function(err) {
if (!err) { if (err) {
winston.info('[reset] Reset complete.'); winston.error('[reset] Errors were encountered while resetting widget areas: ' + err.message);
process.exit();
} else { } else {
winston.error('[reset] Errors were encountered while resetting your forum settings: ' + err.message); winston.info('[reset] All Widgets moved to Draft Zone');
} }
process.exit();
require('async').parallel([resetThemes, resetPlugins], function(err) {
if (!err) {
winston.info('[reset] Reset complete.');
} else {
winston.error('[reset] Errors were encountered while resetting your forum settings: ' + err.message);
}
process.exit();
});
}); });
} else { } else {
console.log('no match'); console.log('no match');
@ -251,6 +262,16 @@ function resetPlugins(callback) {
}); });
} }
function resetWidgets(callback) {
loadConfig();
var db = require('./src/database');
db.init(function() {
require('./src/widgets').reset(callback);
});
}
function shutdown(code) { function shutdown(code) {
winston.info('[app] Shutdown (SIGTERM/SIGINT) Initialised.'); winston.info('[app] Shutdown (SIGTERM/SIGINT) Initialised.');
require('./src/database').close(); require('./src/database').close();

Loading…
Cancel
Save