mirror of
https://github.com/neovim/neovim.git
synced 2026-07-16 06:10:39 +00:00
fix(health): avoid silent failure
This commit is contained in:
@@ -543,19 +543,13 @@ local function check_stable_version(nvim_version)
|
|||||||
if result.code ~= 0 or not result.stdout or result.stdout == '' then
|
if result.code ~= 0 or not result.stdout or result.stdout == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local stable_sha = result.stdout:match('(%x+)%s+refs/tags/stable%^{}')
|
local stable_sha = assert(
|
||||||
or result.stdout:match('(%x+)%s+refs/tags/stable\n')
|
result.stdout:match('(%x+)%s+refs/tags/stable%^{}')
|
||||||
if not stable_sha then
|
or result.stdout:match('(%x+)%s+refs/tags/stable\n')
|
||||||
return
|
)
|
||||||
end
|
local latest_version =
|
||||||
local latest_version = result.stdout:match(stable_sha .. '%s+refs/tags/v?(%d+%.%d+%.%d+)%^{}')
|
assert(result.stdout:match(stable_sha .. '%s+refs/tags/v?(%d+%.%d+%.%d+)%^{}'))
|
||||||
if not latest_version then
|
local current_version = assert(nvim_version:match('v?(%d+%.%d+%.%d+)'))
|
||||||
return
|
|
||||||
end
|
|
||||||
local current_version = nvim_version:match('v?(%d+%.%d+%.%d+)')
|
|
||||||
if not current_version then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local current = vim.version.parse(current_version)
|
local current = vim.version.parse(current_version)
|
||||||
local latest = vim.version.parse(latest_version)
|
local latest = vim.version.parse(latest_version)
|
||||||
if current and latest and vim.version.lt(current, latest) then
|
if current and latest and vim.version.lt(current, latest) then
|
||||||
@@ -576,10 +570,7 @@ local function check_head_hash(commit)
|
|||||||
if result.code ~= 0 or not result.stdout or result.stdout == '' then
|
if result.code ~= 0 or not result.stdout or result.stdout == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local upstream = result.stdout:match('^(%x+)')
|
local upstream = assert(result.stdout:match('^(%x+)'))
|
||||||
if not upstream then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if not vim.startswith(upstream, commit) then
|
if not vim.startswith(upstream, commit) then
|
||||||
vim.health.warn(
|
vim.health.warn(
|
||||||
('Build is outdated. Local: %s, Latest: %s'):format(commit, upstream:sub(1, 12))
|
('Build is outdated. Local: %s, Latest: %s'):format(commit, upstream:sub(1, 12))
|
||||||
|
|||||||
Reference in New Issue
Block a user