mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
refactor(lua): use vim.system #34707
This commit is contained in:

committed by
GitHub

parent
54b8c99e51
commit
35af766de6
@@ -27,8 +27,9 @@ local function run(cmd, or_die)
|
||||
if _trace then
|
||||
p('run: ' .. vim.inspect(cmd))
|
||||
end
|
||||
local rv = vim.trim(vim.fn.system(cmd)) or ''
|
||||
if vim.v.shell_error ~= 0 then
|
||||
local res = vim.system(cmd):wait()
|
||||
local rv = vim.trim(res.stdout)
|
||||
if res.code ~= 0 then
|
||||
if or_die then
|
||||
p(rv)
|
||||
os.exit(1)
|
||||
|
Reference in New Issue
Block a user