diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-02-03 23:09:00 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-02-03 23:09:00 -0500 |
commit | 96c02cf492984219708e5874aff41bbf4558d07d (patch) | |
tree | 54aaef3211c79aada56497612f327e1a82dc015e /plugins/plugin_manager/init.lua | |
parent | 1106c6282520ec536825d0c6c6b80b8750c3f4c9 (diff) | |
download | lite-xl-plugin-manager-96c02cf492984219708e5874aff41bbf4558d07d.tar.gz lite-xl-plugin-manager-96c02cf492984219708e5874aff41bbf4558d07d.zip |
Added in a lot of extra shortcuts, commands, finding, etc; tidied up loading bars.v0.99993
Diffstat (limited to 'plugins/plugin_manager/init.lua')
-rw-r--r-- | plugins/plugin_manager/init.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/plugin_manager/init.lua b/plugins/plugin_manager/init.lua index fe4cba7..82e5442 100644 --- a/plugins/plugin_manager/init.lua +++ b/plugins/plugin_manager/init.lua @@ -111,7 +111,6 @@ local function run(cmd, progress) local progress_line progress_line, v[3] = extract_progress(v[3]) if progress and progress_line then - print(chunk) progress_line = json.decode(progress_line) progress(progress_line.progress) end @@ -178,22 +177,22 @@ function PluginManager:get_addons() return prom end -local function run_stateful_plugin_command(plugin_manager, cmd, arg) +local function run_stateful_plugin_command(plugin_manager, cmd, arg, progress) local promise = Promise.new() - run({ cmd, arg }):done(function(result) + run({ cmd, arg }, progress):done(function(result) if config.plugins.plugin_manager.restart_on_change then command.perform("core:restart") else - plugin_manager:refresh():forward(promise) + plugin_manager:refresh(progress):forward(promise) end end) return promise end -function PluginManager:install(addon) return run_stateful_plugin_command(self, "install", addon.id .. (addon.version and (":" .. addon.version) or "")) end -function PluginManager:uninstall(addon) return run_stateful_plugin_command(self, "uninstall", addon.id) end -function PluginManager:reinstall(addon) return run_stateful_plugin_command(self, "reinstall", addon.id) end +function PluginManager:install(addon, progress) return run_stateful_plugin_command(self, "install", addon.id .. (addon.version and (":" .. addon.version) or ""), progress) end +function PluginManager:uninstall(addon, progress) return run_stateful_plugin_command(self, "uninstall", addon.id, progress) end +function PluginManager:reinstall(addon, progress) return run_stateful_plugin_command(self, "reinstall", addon.id, progress) end function PluginManager:get_addon(name_and_version) |