|
|
|
@ -81,7 +81,17 @@ if (!nconf.get('help') && !nconf.get('setup') && !nconf.get('install') && !nconf
|
|
|
|
|
resetThemes();
|
|
|
|
|
} else if (nconf.get('plugins')) {
|
|
|
|
|
resetPlugins();
|
|
|
|
|
} else if (nconf.get('widgets')) {
|
|
|
|
|
resetWidgets();
|
|
|
|
|
} else if (nconf.get('all')) {
|
|
|
|
|
resetWidgets(function(err) {
|
|
|
|
|
if (err) {
|
|
|
|
|
winston.error('[reset] Errors were encountered while resetting widget areas: ' + err.message);
|
|
|
|
|
process.exit();
|
|
|
|
|
} else {
|
|
|
|
|
winston.info('[reset] All Widgets moved to Draft Zone');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
require('async').parallel([resetThemes, resetPlugins], function(err) {
|
|
|
|
|
if (!err) {
|
|
|
|
|
winston.info('[reset] Reset complete.');
|
|
|
|
@ -90,6 +100,7 @@ if (!nconf.get('help') && !nconf.get('setup') && !nconf.get('install') && !nconf
|
|
|
|
|
}
|
|
|
|
|
process.exit();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
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) {
|
|
|
|
|
winston.info('[app] Shutdown (SIGTERM/SIGINT) Initialised.');
|
|
|
|
|
require('./src/database').close();
|
|
|
|
|