Skip to content

Commit

Permalink
fix(lib/process): raise errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarriga committed Jul 10, 2022
1 parent efcee31 commit d83e34a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/neotest/lib/process/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function M.run(command, args)
local result_code
local send_exit, await_exit = async.control.channel.oneshot()

local handle, _ = vim.loop.spawn(command[1], {
local handle, pid = vim.loop.spawn(command[1], {
stdio = { stdin, stdout, stderr },
detached = false,
args = #command > 1 and vim.list_slice(command, 2, #command) or nil,
Expand All @@ -28,6 +28,10 @@ function M.run(command, args)
send_exit()
end)

if not handle then
error(pid)
end

await_exit()
handle:close()

Expand Down

0 comments on commit d83e34a

Please sign in to comment.