Skip to content

Commit

Permalink
fix(process): make sure cwd is a valid directory
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 10, 2023
1 parent 736529d commit 92869d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/lazy/manage/process.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ function M.spawn(cmd, opts)
end)
end

-- make sure the cwd is valid
if not opts.cwd and type(uv.cwd()) ~= "string" then
opts.cwd = uv.os_homedir()
end

handle = uv.spawn(cmd, {
stdio = { nil, stdout, stderr },
args = opts.args,
Expand Down

0 comments on commit 92869d0

Please sign in to comment.