Skip to content

Commit

Permalink
feat(health): show exact version of yazi and ya in health check (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas authored Jul 22, 2024
1 parent 009c930 commit a2f6e2b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions integration-tests/cypress/e2e/healthcheck.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ describe("the healthcheck", () => {
)

// the `yazi` and `ya` applications should be found successfully
cy.contains("Found yazi version 0.2.5")
cy.contains("Found ya version 0.2.5")
cy.contains("Found yazi version Yazi 0.2.5")
cy.contains("Found ya version Ya 0.2.5")
cy.contains("OK yazi")
})
})
10 changes: 8 additions & 2 deletions lua/yazi/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ return {
'yazi version is too old, please upgrade to 0.2.5 or newer'
)
else
vim.health.info(('Found `yazi` version `%s` 👍'):format(yazi_semver))
vim.health.info(
('Found `yazi` version `%s` 👍'):format(raw_version:gsub('\n', ''))
)
end

local logfile_location = require('yazi.log'):get_logfile_path()
Expand Down Expand Up @@ -87,7 +89,11 @@ return {
'The `ya` executable version (yazi command line interface) is too old. Please upgrade to the newest version.'
)
else
vim.health.info(('Found `ya` version `%s` 👍'):format(ya_semver))
vim.health.info(
('Found `ya` version `%s` 👍'):format(
raw_ya_version:gsub('\n', '')
)
)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/yazi/health_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Options:
yazi.setup({ use_ya_for_events_reading = true })
vim.cmd('checkhealth yazi')

assert_buffer_contains_text('Found `yazi` version `0.2.5`')
assert_buffer_contains_text('Found `ya` version `0.2.5`')
assert_buffer_contains_text('Found `yazi` version `yazi 0.2.5')
assert_buffer_contains_text('Found `ya` version `Ya 0.2.5')
assert_buffer_contains_text('OK yazi')
end)

Expand Down

0 comments on commit a2f6e2b

Please sign in to comment.