Skip to content

Commit

Permalink
fix: fix error in PluginManage command
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Feb 23, 2024
1 parent 2a2d40e commit 8673a8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ll/core/command/PluginManage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ void registerPluginManageCommand() {
) {
switch (param.operation) {
case LeviCommandOperation::load:
if (ll::plugin::PluginManagerRegistry::getInstance().hasPlugin(param.plugin)) {
if (!ll::plugin::PluginManagerRegistry::getInstance().hasPlugin(param.plugin)) {
if (ll::plugin::PluginRegistrar::getInstance().loadPlugin(param.plugin)) {
output.success("Load plugin {0} successfully"_tr(param.plugin));
} else {
output.error("Failed to load plugin {0}"_tr(param.plugin));
}
} else {
output.error("Plugin {0} not found"_tr(param.plugin));
output.error("Plugin already {0} loaded"_tr(param.plugin));
}
break;
case LeviCommandOperation::unload:
Expand All @@ -65,8 +65,8 @@ void registerPluginManageCommand() {
break;
case LeviCommandOperation::reload:
if (ll::plugin::PluginManagerRegistry::getInstance().hasPlugin(param.plugin)) {
if (ll::plugin::PluginRegistrar::getInstance().loadPlugin(param.plugin)
&& ll::plugin::PluginRegistrar::getInstance().unloadPlugin(param.plugin)) {
if (ll::plugin::PluginRegistrar::getInstance().unloadPlugin(param.plugin)
&& ll::plugin::PluginRegistrar::getInstance().loadPlugin(param.plugin)) {
output.success("Reload plugin {0} successfully"_tr(param.plugin));
} else {
output.error("Failed to reload plugin {0}"_tr(param.plugin));
Expand Down

0 comments on commit 8673a8a

Please sign in to comment.