From 96c02cf492984219708e5874aff41bbf4558d07d Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Fri, 3 Feb 2023 23:09:00 -0500 Subject: Added in a lot of extra shortcuts, commands, finding, etc; tidied up loading bars. --- plugins/plugin_manager/init.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'plugins/plugin_manager/init.lua') diff --git a/plugins/plugin_manager/init.lua b/plugins/plugin_manager/init.lua index fe4cba7..82e5442 100644 --- a/plugins/plugin_manager/init.lua +++ b/plugins/plugin_manager/init.lua @@ -111,7 +111,6 @@ local function run(cmd, progress) local progress_line progress_line, v[3] = extract_progress(v[3]) if progress and progress_line then - print(chunk) progress_line = json.decode(progress_line) progress(progress_line.progress) end @@ -178,22 +177,22 @@ function PluginManager:get_addons() return prom end -local function run_stateful_plugin_command(plugin_manager, cmd, arg) +local function run_stateful_plugin_command(plugin_manager, cmd, arg, progress) local promise = Promise.new() - run({ cmd, arg }):done(function(result) + run({ cmd, arg }, progress):done(function(result) if config.plugins.plugin_manager.restart_on_change then command.perform("core:restart") else - plugin_manager:refresh():forward(promise) + plugin_manager:refresh(progress):forward(promise) end end) return promise end -function PluginManager:install(addon) return run_stateful_plugin_command(self, "install", addon.id .. (addon.version and (":" .. addon.version) or "")) end -function PluginManager:uninstall(addon) return run_stateful_plugin_command(self, "uninstall", addon.id) end -function PluginManager:reinstall(addon) return run_stateful_plugin_command(self, "reinstall", addon.id) end +function PluginManager:install(addon, progress) return run_stateful_plugin_command(self, "install", addon.id .. (addon.version and (":" .. addon.version) or ""), progress) end +function PluginManager:uninstall(addon, progress) return run_stateful_plugin_command(self, "uninstall", addon.id, progress) end +function PluginManager:reinstall(addon, progress) return run_stateful_plugin_command(self, "reinstall", addon.id, progress) end function PluginManager:get_addon(name_and_version) -- cgit v1.2.3