This commit is contained in:
Spencer Gray 2025-07-14 21:31:29 +00:00 committed by GitHub
commit 465764ad07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -43,7 +43,7 @@ function M.have(cmd, opts)
else
local version = vim.trim(out[1] or "")
version = version:gsub("^%s*" .. vim.pesc(c) .. "%s*", "")
if opts.version_pattern and not version:find(opts.version_pattern, 1, true) then
if opts.version_pattern and not version:find(opts.version_pattern) then
opts.warn(("`%s` version `%s` needed, but found `%s`"):format(c, opts.version_pattern, version))
else
found = ("{%s} `%s`"):format(c, version)
@ -59,7 +59,7 @@ function M.have(cmd, opts)
(opts.optional and opts.warn or opts.error)(
("{%s} %snot installed"):format(
table.concat(cmd, "} or {"),
opts.version_pattern and "version `" .. opts.version_pattern .. "` " or ""
opts.version_pattern and "version matching `" .. opts.version_pattern .. "` " or ""
)
)
end

View file

@ -82,7 +82,7 @@ function M.check(opts)
M.hererocks.bin("lua"),
vim.tbl_extend("force", opts, {
version = "-v",
version_pattern = "5.1",
version_pattern = "5%.[1-9]",
})
)
end
@ -92,7 +92,7 @@ function M.check(opts)
{ "lua5.1", "lua", "lua-5.1" },
vim.tbl_extend("force", opts, {
version = "-v",
version_pattern = "5.1",
version_pattern = "5%.[1-9]",
})
)
end