Skip to content

Commit

Permalink
Added in small optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamharrison committed Oct 19, 2024
1 parent d050e5c commit 2e703e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lpm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,10 @@ function Addon:get_path(bottle)
end

function Addon:get_compatibilities(bottle)
local dependency_list = common.canonical_order(self.dependencies)
if #dependency_list == 0 then return {}, {} end
local compatible_addons, incompatible_addons = {}, {}
local installed_addons = bottle:installed_addons()
local dependency_list = common.canonical_order(self.dependencies)
for _, addon in ipairs(dependency_list) do
local v = self.dependencies[addon]
local potential_addons = { bottle:get_addon(addon, v.version, MOD_VERSION ~= "any" and { mod_version = bottle.lite_xl.mod_version }) }
Expand Down Expand Up @@ -861,6 +862,7 @@ function Addon:install(bottle, installing)
local install_path = self:get_install_path(bottle)
if install_path:find(USERDIR, 1, true) ~= 1 and install_path:find(TMPDIR, 1, true) ~= 1 then error("invalid install path: " .. install_path) end
local temporary_install_path = TMPDIR .. PATHSEP .. install_path:sub(((install_path:find(TMPDIR, 1, true) == 1) and #TMPDIR or #USERDIR) + 2)

local status, err = pcall(function()
installing = installing or {}
installing[self.id] = true
Expand Down

0 comments on commit 2e703e0

Please sign in to comment.