Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output path to curl executable and version in checkhealth #239

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lua/kulala/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ M.check = function()
info("{kulala.nvim} version " .. GLOBALS.VERSION)
local curl = CONFIG.get().curl_path
if FS.command_exists(curl) then
ok(string.format("{%s} found", curl))
local curl_path = FS.command_path(curl)
local curl_version = vim.fn.system({ curl_path, "--version" })
ok(string.format("{curl} found: %s (version: %s)", curl_path, curl_version:gsub("^curl ([^ ]+).*", "%1")))
else
error(string.format("{%s} not found", curl))
end
Expand Down
4 changes: 4 additions & 0 deletions lua/kulala/utils/fs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ M.command_exists = function(cmd)
return vim.fn.executable(cmd) == 1
end

M.command_path = function(cmd)
return vim.fn.exepath(cmd)
end

M.get_plugin_root_dir = function()
local source = debug.getinfo(1).source
local dir_path = source:match("@(.*/)") or source:match("@(.*\\)")
Expand Down