diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-11-27 11:54:42 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-11-27 11:54:42 -0500 |
commit | 6b2623a3ecee1ae9ed7fc96c0ad9e32c61860bdd (patch) | |
tree | 6479b3d550cd34a09a1eee1be3b99c3b76e994fe /plugins/plugin_manager/init.lua | |
parent | 2817b43ec5d727cf89655d799cfadb42fcf0eadb (diff) | |
download | lite-xl-plugin-manager-6b2623a3ecee1ae9ed7fc96c0ad9e32c61860bdd.tar.gz lite-xl-plugin-manager-6b2623a3ecee1ae9ed7fc96c0ad9e32c61860bdd.zip |
Ensured we always pass around options so we can track progress one way or another.
Diffstat (limited to 'plugins/plugin_manager/init.lua')
-rw-r--r-- | plugins/plugin_manager/init.lua | 16 |
1 files changed, 8 insertions, 8 deletions
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() |