fix(rocks): if installing with luarocks (binaries) fails, then build from source. Fixes #1563

This commit is contained in:
Folke Lemaitre 2024-06-27 11:33:11 +02:00
parent e02c5b1b57
commit 82276321f5
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 35 additions and 2 deletions

View file

@ -37,7 +37,7 @@ function Task.new(plugin, name, task, opts)
local self = setmetatable({}, { __index = Task })
self._opts = opts or {}
self._log = {}
self._level = vim.log.levels.TRACE
self:set_level()
self.plugin = plugin
self.name = name
---@param other LazyTask
@ -95,6 +95,11 @@ function Task:has_warnings()
return self._level >= vim.log.levels.WARN
end
---@param level? number
function Task:set_level(level)
self._level = level or vim.log.levels.TRACE
end
---@private
---@param task LazyTaskFn
function Task:_start(task)
@ -218,6 +223,7 @@ function Task:spawn(cmd, opts)
end
local running = true
local ret = true
---@param output string
function opts.on_exit(ok, output)
if not headless then
@ -226,6 +232,7 @@ function Task:spawn(cmd, opts)
if on_exit then
pcall(on_exit, ok, output)
end
ret = ok
running = false
end
@ -240,6 +247,7 @@ function Task:spawn(cmd, opts)
while running do
coroutine.yield()
end
return ret
end
function Task:prefix()