From d17e85ebdb4b1f9204505c1bed1b8dae3b80f2af Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 19 Feb 2023 23:20:44 -0500 Subject: Added in purge, and added in additional paths. --- plugins/plugin_manager/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/plugin_manager/init.lua') diff --git a/plugins/plugin_manager/init.lua b/plugins/plugin_manager/init.lua index 9dee036..3e69884 100644 --- a/plugins/plugin_manager/init.lua +++ b/plugins/plugin_manager/init.lua @@ -41,6 +41,7 @@ if not config.plugins.plugin_manager.lpm_binary_path then local path, s = os.getenv("PATH"), 1 while true do local _, e = path:find(":", s) + table.insert(paths, path:sub(s, e and (e-1) or #path) .. PATHSEP .. config.plugins.plugin_manager.lpm_binary_name) table.insert(paths, path:sub(s, e and (e-1) or #path) .. PATHSEP .. "lpm" .. binary_extension) if not e then break end s = e + 1 @@ -176,6 +177,12 @@ function PluginManager:upgrade(progress) end + +function PluginManager:purge(progress) + return run({ "purge" }, progress) +end + + function PluginManager:get_addons() local prom = Promise.new() if self.addons then @@ -312,6 +319,7 @@ command.add(nil, { end, ["plugin-manager:refresh"] = function() PluginManager:refresh(PluginManager.view.progress_callback):done(function() core.log("Successfully refreshed plugin listing.") end) end, ["plugin-manager:upgrade"] = function() PluginManager:upgrade(PluginManager.view.progress_callback):done(function() core.log("Successfully upgraded installed plugins.") end) end, + ["plugin-manager:purge"] = function() PluginManager:purge(PluginManager.view.progress_callback):done(function() core.log("Successfully purged lpm directory.") end) end, ["plugin-manager:show"] = function() local node = core.root_view:get_active_node_default() node:add_view(PluginManager.view(PluginManager)) -- cgit v1.2.3