aboutsummaryrefslogtreecommitdiff
path: root/plugins/plugin_manager/init.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-10-10 11:45:21 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-10-10 11:45:21 -0400
commit51f89bcc8a6f3f0f3f36788f5559f2d3e38788f1 (patch)
treebfe96ebf6d93e1b4b57542a9173b92c1350b2912 /plugins/plugin_manager/init.lua
parent3d4390468181af1e329ba93c9776c906f63b8478 (diff)
downloadlite-xl-plugin-manager-51f89bcc8a6f3f0f3f36788f5559f2d3e38788f1.tar.gz
lite-xl-plugin-manager-51f89bcc8a6f3f0f3f36788f5559f2d3e38788f1.zip
Added in an unstub and VIEW readme function.
Diffstat (limited to 'plugins/plugin_manager/init.lua')
-rw-r--r--plugins/plugin_manager/init.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/plugin_manager/init.lua b/plugins/plugin_manager/init.lua
index 274776a..9ed1c28 100644
--- a/plugins/plugin_manager/init.lua
+++ b/plugins/plugin_manager/init.lua
@@ -195,9 +195,9 @@ function PluginManager:get_addons()
return prom
end
-local function run_stateful_plugin_command(plugin_manager, cmd, arg, options)
+local function run_stateful_plugin_command(plugin_manager, cmd, args, options)
local promise = Promise.new()
- run({ cmd, arg }, options.progress):done(function(result)
+ run({ cmd, table.unpack(args) }, options.progress):done(function(result)
if (options.restart == nil and config.plugins.plugin_manager.restart_on_change) or options.restart then
command.perform("core:restart")
else
@@ -208,9 +208,10 @@ local function run_stateful_plugin_command(plugin_manager, cmd, arg, options)
end
-function PluginManager:install(addon, options) return run_stateful_plugin_command(self, "install", addon.id .. (addon.version and (":" .. addon.version) or ""), options) end
-function PluginManager:uninstall(addon, options) return run_stateful_plugin_command(self, "uninstall", addon.id, options) end
-function PluginManager:reinstall(addon, options) return run_stateful_plugin_command(self, "reinstall", addon.id, options) end
+function PluginManager:install(addon, options) return run_stateful_plugin_command(self, "install", { addon.id .. (addon.version and (":" .. addon.version) or "") }, options) end
+function PluginManager:reinstall(addon, options) return run_stateful_plugin_command(self, "install", { addon.id .. (addon.version and (":" .. addon.version) or ""), "--reinstall" }, options) end
+function PluginManager:uninstall(addon, options) return run_stateful_plugin_command(self, "uninstall", { addon.id }, options) end
+function PluginManager:unstub(addon, options) return run_stateful_plugin_command(self, "unstub", { addon.id }, options) end
function PluginManager:get_addon(name_and_version)