aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2024-02-25 15:25:29 -0500
committerAdam Harrison <adamdharrison@gmail.com>2024-02-25 15:25:29 -0500
commit59af3e691bc5d0a35df4fef65a1d98b29454b612 (patch)
tree5eb4da6da5d591aa61881e6cbf3b8f74313fd975 /src/lpm.lua
parent22597dd5db00bf91cabf803f3e5515d61a9182bf (diff)
downloadlite-xl-plugin-manager-59af3e691bc5d0a35df4fef65a1d98b29454b612.tar.gz
lite-xl-plugin-manager-59af3e691bc5d0a35df4fef65a1d98b29454b612.zip
Threw an explicit error if you try to install a repository with no addons selected.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index f4dbbbe..d661e42 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -1758,6 +1758,7 @@ end
local function lpm_install(type, ...)
+ local repo_only = nil
local to_install = {}
local to_explicitly_install = {}
for i, identifier in ipairs({ ... }) do
@@ -1770,7 +1771,9 @@ local function lpm_install(type, ...)
if is_argument_repo(identifier) then
table.insert(repositories, 1, Repository.url(identifier):add(AUTO_PULL_REMOTES))
system_bottle:invalidate_cache()
+ if repo_only == nil then repo_only = true end
else
+ repo_only = false
local potential_addons = { system_bottle:get_addon(id, version, { mod_version = system_bottle.lite_xl.mod_version, type = type }) }
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
@@ -1786,6 +1789,7 @@ local function lpm_install(type, ...)
end
end
end
+ if #to_install == 0 and repo_only == true then error("no addons specified for install") end
common.each(to_install, function(e) e:install(system_bottle) end)
settings.installed = common.concat(settings.installed, to_explicitly_install)
lpm_settings_save()