Skip to content

Commit

Permalink
fix: add PATH onto sg-cody vim.loop.spawn, solves the case cmd is 'sg…
Browse files Browse the repository at this point in the history
…-cody'
  • Loading branch information
Pegasust committed Jun 22, 2023
1 parent 2123faf commit 08c217c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/sg/request.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local function discover_sg_cody()
return cmd
end

sg_cody_process = discover_sg_cody()
local sg_cody_process = discover_sg_cody()

local uv = vim.loop

Expand Down Expand Up @@ -65,6 +65,7 @@ M.start = function(force)
handle, pid = uv.spawn(sg_cody_process, {
stdio = { stdin, stdout, stderr },
env = {
"PATH=" .. vim.env.PATH,
"SRC_ACCESS_TOKEN=" .. (vim.env.SRC_ACCESS_TOKEN or ""),
"SRC_ENDPOINT=" .. (vim.env.SRC_ENDPOINT or ""),
},
Expand Down

0 comments on commit 08c217c

Please sign in to comment.