Skip to content

Commit f9b5ec8

Browse files
author
Jose Alvarez
authored
Revert "fix(utils): resolve symlinks before testing executable bit (#1017)" (#1070)
This reverts commit bd7e4de.
1 parent 65a9e5c commit f9b5ec8

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

lua/null-ls/utils.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ end
8585
---@param cmd string? command to check
8686
---@return boolean, string is_executable, string|nil error_message
8787
M.is_executable = function(cmd)
88-
if cmd and vim.fn.executable(vim.fn.resolve(vim.fn.exepath(cmd))) == 1 then
88+
if cmd and vim.fn.executable(cmd) == 1 then
8989
return true
9090
end
9191

test/spec/utils_spec.lua

-8
Original file line numberDiff line numberDiff line change
@@ -104,26 +104,18 @@ describe("utils", function()
104104

105105
describe("is_executable", function()
106106
local executable
107-
local resolve
108-
local exepath
109107
before_each(function()
110108
executable = stub(vim.fn, "executable")
111-
resolve = stub(vim.fn, "resolve")
112-
exepath = stub(vim.fn, "exepath")
113109
end)
114110
after_each(function()
115111
executable:revert()
116112
end)
117113

118114
it("should call executable with command", function()
119115
executable.returns(0)
120-
resolve.returns("mock-command")
121-
exepath.returns("mock-command")
122116

123117
u.is_executable("mock-command")
124118

125-
assert.stub(exepath).was_called_with("mock-command")
126-
assert.stub(resolve).was_called_with("mock-command")
127119
assert.stub(executable).was_called_with("mock-command")
128120
end)
129121

0 commit comments

Comments
 (0)