aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-07-24 16:07:50 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-07-24 16:07:50 -0400
commitea9c1b8cc37bf37299b336d86408e6a88122e0c3 (patch)
tree2d6b6c333accdfed38eff58f90ec96d2d79ff4ae /src/lpm.lua
parent6579e42beca25f0a4ec63fb76373e0facfc28a12 (diff)
downloadlite-xl-plugin-manager-ea9c1b8cc37bf37299b336d86408e6a88122e0c3.tar.gz
lite-xl-plugin-manager-ea9c1b8cc37bf37299b336d86408e6a88122e0c3.zip
Added in quick way to just grab and install orphan plugins.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua22
1 files changed, 13 insertions, 9 deletions
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