fix(image): don't fallback to convert on windows, since that is a system tool

This commit is contained in:
Folke Lemaitre 2025-02-17 14:29:25 +01:00
parent 20e5b0fdbf
commit c1a1984fdb
No known key found for this signature in database
GPG key ID: 36B7C1C85AAC487F
2 changed files with 7 additions and 1 deletions

View file

@ -193,7 +193,8 @@ end
---@private
function M.health()
Snacks.health.have_tool({ "kitty", "wezterm", "ghostty" })
if not Snacks.health.have_tool({ "magick", "convert" }) then
local is_win = jit.os:find("Windows")
if not Snacks.health.have_tool({ "magick", not is_win and "convert" or nil }) then
Snacks.health.error("`magick` is required to convert images. Only PNG files will be displayed.")
end
local env = M.terminal.env()