mirror of
https://github.com/neovim/neovim.git
synced 2026-01-03 09:56:25 +10:00
fix(vim.system): improve error message when cwd does not exist
Problem: vim.uv.spawn will emit ENOENT for either when the cmd or cwd do not exist and does not tell you which. Solution: If an error occurs, check if cwd was supplied and included in the error message if it does not exist.
This commit is contained in:
committed by
Lewis Russell
parent
cc264d51ab
commit
532610388b
@@ -55,9 +55,14 @@ describe('vim.system', function()
|
||||
describe('(' .. name .. ')', function()
|
||||
it('failure modes', function()
|
||||
t.matches(
|
||||
'ENOENT%: no such file .*: "non%-existent%-cmd"',
|
||||
"ENOENT%: no such file .* %(cmd%): 'non%-existent%-cmd'",
|
||||
t.pcall_err(system, { 'non-existent-cmd', 'arg1', 'arg2' }, { text = true })
|
||||
)
|
||||
|
||||
t.matches(
|
||||
"ENOENT%: no such file .* %(cwd%): 'non%-existent%-cwd'",
|
||||
t.pcall_err(system, { 'echo', 'hello' }, { cwd = 'non-existent-cwd', text = true })
|
||||
)
|
||||
end)
|
||||
|
||||
it('can run simple commands', function()
|
||||
|
||||
Reference in New Issue
Block a user