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

🐛 Windows: allow binary without extension #3093

Merged
merged 2 commits into from
May 14, 2024
Merged
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
9 changes: 6 additions & 3 deletions lua/telescope/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ local required_plugins = {
local check_binary_installed = function(package)
local binaries = package.binaries or { package.name }
for _, binary in ipairs(binaries) do
if is_win then
local found = vim.fn.executable(binary) == 1
if not found and is_win then
binary = binary .. ".exe"
found = vim.fn.executable(binary) == 1
jamestrew marked this conversation as resolved.
Show resolved Hide resolved
end
if vim.fn.executable(binary) == 1 then
if found then
local handle = io.popen(binary .. " --version")
local binary_version = handle:read "*a"
handle:close()
Expand Down Expand Up @@ -101,7 +103,8 @@ M.check = function()
end
else
local eol = version:find "\n"
ok(("%s: found %s"):format(package.name, version:sub(0, eol - 1) or "(unknown version)"))
local ver = eol and version:sub(0, eol - 1) or "(unknown version)"
ok(("%s: found %s"):format(package.name, ver))
end
end
end
Expand Down