diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-05-27 17:18:58 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-06-13 10:05:46 -0400 |
commit | eda4dc864dd26f6da2da9ee3382978ee77f8c8e0 (patch) | |
tree | 6d6c1b7d2948cfda598c5aaa64f5da827364ee0d | |
parent | 15a2bff4f2aaffecf6072ab0032ebc841d2c2c17 (diff) | |
download | lite-xl-plugin-manager-eda4dc864dd26f6da2da9ee3382978ee77f8c8e0.tar.gz lite-xl-plugin-manager-eda4dc864dd26f6da2da9ee3382978ee77f8c8e0.zip |
Moved sort up because of the g-man.
-rw-r--r-- | src/lpm.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 15b4f21..8e54921 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -888,9 +888,9 @@ end function Addon:uninstall(bottle, uninstalling) local install_path = self:get_install_path(bottle) if self:is_core(bottle) then error("can't uninstall " .. self.id .. "; is a core addon") end - local orphans = self:get_orphaned_dependencies(bottle) + local orphans = common.sort(self:get_orphaned_dependencies(bottle), function(a, b) return a.id < b.id end) if #orphans > 0 and (uninstalling or prompt("Uninstalling " .. self.id .. " will leave the following orphans: " .. common.join(", ", common.map(orphans, function(e) return e.id end)).. ". Do you want to uninstall them as well?")) then - common.each(common.sort(orphans, function(a, b) return a.id < b.id end), function(e) e:uninstall(bottle, common.merge(uninstalling or {}, { [self.id] = true })) end) + common.each(orphans, function(e) e:uninstall(bottle, common.merge(uninstalling or {}, { [self.id] = true })) end) end log_action("Uninstalling " .. self.type .. " located at " .. install_path) local incompatible_addons = common.grep(bottle:installed_addons(), function(p) return p:depends_on(self) and (not uninstalling or not uninstalling[p.id]) end) |