From 6b2623a3ecee1ae9ed7fc96c0ad9e32c61860bdd Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 27 Nov 2023 11:54:42 -0500 Subject: Ensured we always pass around options so we can track progress one way or another. --- plugins/plugin_manager/init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/plugin_manager/init.lua') diff --git a/plugins/plugin_manager/init.lua b/plugins/plugin_manager/init.lua index 7f4e5eb..520dd51 100644 --- a/plugins/plugin_manager/init.lua +++ b/plugins/plugin_manager/init.lua @@ -185,7 +185,7 @@ function PluginManager:purge(options) end -function PluginManager:get_addons() +function PluginManager:get_addons(options) local prom = Promise.new() if self.addons then prom:resolve(self.addons) @@ -228,9 +228,9 @@ function PluginManager:unstub(addon, options) end -function PluginManager:get_addon(name_and_version) +function PluginManager:get_addon(name_and_version, options) local promise = Promise.new() - PluginManager:get_addons():done(function() + PluginManager:get_addons(options):done(function() local s = name_and_version:find(":") local name, version = name_and_version, nil if s then @@ -255,10 +255,10 @@ PluginManager.view = require "plugins.plugin_manager.plugin_view" command.add(nil, { ["plugin-manager:install"] = function() - PluginManager:get_addons() + PluginManager:get_addons({ progress = PluginManager.view.progress_callback }) core.command_view:enter("Enter plugin name", function(name) - PluginManager:get_addon(name):done(function(addon) + PluginManager:get_addon(name, { progress = PluginManager.view.progress_callback }):done(function(addon) core.log("Attempting to install plugin " .. name .. "...") PluginManager:install(addon, { progress = PluginManager.view.progress_callback }):done(function() core.log("Successfully installed plugin " .. addon.id .. ".") @@ -280,10 +280,10 @@ command.add(nil, { ) end, ["plugin-manager:uninstall"] = function() - PluginManager:get_addons() + PluginManager:get_addons({ progress = PluginManager.view.progress_callback }) core.command_view:enter("Enter plugin name", function(name) - PluginManager:get_addon(name):done(function(addon) + PluginManager:get_addon(name, { progress = PluginManager.view.progress_callback }):done(function(addon) core.log("Attempting to uninstall plugin " .. addon.id .. "...") PluginManager:uninstall(addon, { progress = PluginManager.view.progress_callback }):done(function() core.log("Successfully uninstalled plugin " .. addon.id .. ".") @@ -314,7 +314,7 @@ command.add(nil, { ) end, ["plugin-manager:remove-repository"] = function() - PluginManager:get_plugins() + PluginManager:get_addons({ progress = PluginManager.view.progress_callback }) core.command_view:enter("Enter repository url", function(url) PluginManager:remove(url):done(function() -- cgit v1.2.3