fix: don't move theme/plugin to top if its already active

This commit is contained in:
Barış Soner Uşaklı
2019-09-05 13:31:42 -04:00
parent 1796b65d34
commit acd9576489
3 changed files with 43 additions and 44 deletions

View File

@@ -63,9 +63,19 @@ function activate(plugin) {
if (!isInstalled) {
return next(new Error('plugin not installed'));
}
plugins.isActive(plugin, next);
},
function (isActive, next) {
if (isActive) {
winston.info('Plugin `%s` already active', plugin);
process.exit(0);
}
db.sortetSetCard('plugins:active', next);
},
function (numPlugins, next) {
winston.info('Activating plugin `%s`', plugin);
db.sortedSetAdd('plugins:active', 0, plugin, next);
db.sortedSetAdd('plugins:active', numPlugins, plugin, next);
},
function (next) {
events.log({