From ea9c1b8cc37bf37299b336d86408e6a88122e0c3 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 24 Jul 2023 16:07:50 -0400 Subject: Added in quick way to just grab and install orphan plugins. --- src/lpm.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/lpm.lua') diff --git a/src/lpm.lua b/src/lpm.lua index 1678a34..dc8e7f8 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1676,16 +1676,20 @@ local function lpm_install(type, ...) if id == "lite-xl" then lpm_lite_xl_install(version) else - local potential_addons = { system_bottle:get_addon(id, version, { mod_version = system_bottle.lite_xl.mod_version }) } - local addons = common.grep(potential_addons, function(e) return e:is_installable(system_bottle) and (not e:is_installed(system_bottle) or REINSTALL) end) - if #addons == 0 and #potential_addons == 0 then error("can't find " .. (type or "addon") .. " " .. id .. " mod-version: " .. (system_bottle.lite_xl.mod_version or 'any')) end - if #addons == 0 then - log_warning((potential_addons[1].type or "addon") .. " " .. id .. " already installed") - if not common.first(settings.installed, id) then table.insert(to_explicitly_install, id) end + if identifier:find("^http") then + table.insert(repositories, 1, Repository.url(identifier):add(AUTO_PULL_REMOTES)) else - for j,v in ipairs(addons) do - if not common.first(settings.installed, v.id) then table.insert(to_explicitly_install, v.id) end - table.insert(to_install, v) + local potential_addons = { system_bottle:get_addon(id, version, { mod_version = system_bottle.lite_xl.mod_version }) } + local addons = common.grep(potential_addons, function(e) return e:is_installable(system_bottle) and (not e:is_installed(system_bottle) or REINSTALL) end) + if #addons == 0 and #potential_addons == 0 then error("can't find " .. (type or "addon") .. " " .. id .. " mod-version: " .. (system_bottle.lite_xl.mod_version or 'any')) end + if #addons == 0 then + log_warning((potential_addons[1].type or "addon") .. " " .. id .. " already installed") + if not common.first(settings.installed, id) then table.insert(to_explicitly_install, id) end + else + for j,v in ipairs(addons) do + if not common.first(settings.installed, v.id) then table.insert(to_explicitly_install, v.id) end + table.insert(to_install, v) + end end end end -- cgit v1.2.3