refactor(nvim): improve handling of image.nvim installation failure
This commit is contained in:
parent
1d8f8f86f8
commit
3b65549788
@ -5,10 +5,16 @@ return {
|
|||||||
---@type vim.SystemCompleted
|
---@type vim.SystemCompleted
|
||||||
local out = vim.system({ "luarocks", "--lua-version", "5.1", "--local", "install", "magick" }):wait()
|
local out = vim.system({ "luarocks", "--lua-version", "5.1", "--local", "install", "magick" }):wait()
|
||||||
if out.code ~= 0 then
|
if out.code ~= 0 then
|
||||||
|
-- Delete it to ensure this builder script is ran again on next update/sync/etc.
|
||||||
|
vim.fn.delete(vim.fn.stdpath("data") .. "/lazy/image.nvim", "rf")
|
||||||
error(
|
error(
|
||||||
string.format(
|
string.format(
|
||||||
"Failed to install `magick` luarock for image.nvim!\n---STDOUT---\n%s\n\n---STDERR---\n\n%s", out.stdout,
|
"Failed to install `magick` luarock for image.nvim!\n---STDOUT---\n%s\n\n---STDERR---\n\n%s",
|
||||||
out.stderr), vim.log.levels.ERROR)
|
out.stdout,
|
||||||
|
out.stderr
|
||||||
|
),
|
||||||
|
vim.log.levels.ERROR
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
ft = { "markdown", "norg" },
|
ft = { "markdown", "norg" },
|
||||||
|
Loading…
Reference in New Issue
Block a user