diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-02-19 23:20:44 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-02-19 23:20:44 -0500 |
commit | d17e85ebdb4b1f9204505c1bed1b8dae3b80f2af (patch) | |
tree | 4530c9f72311b3c360982f9d0fc317d2487cebb6 /plugins/plugin_manager/init.lua | |
parent | 0b6bcfa29fa55e2a69fd9b01e8633abf808344ef (diff) | |
download | lite-xl-plugin-manager-d17e85ebdb4b1f9204505c1bed1b8dae3b80f2af.tar.gz lite-xl-plugin-manager-d17e85ebdb4b1f9204505c1bed1b8dae3b80f2af.zip |
Added in purge, and added in additional paths.
Diffstat (limited to 'plugins/plugin_manager/init.lua')
-rw-r--r-- | plugins/plugin_manager/init.lua | 8 |
1 files changed, 8 insertions, 0 deletions
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)) |