refactor(lua): use vim.system #34707

This commit is contained in:
Yochem van Rosmalen
2025-07-24 05:03:30 +02:00
committed by GitHub
parent 54b8c99e51
commit 35af766de6
9 changed files with 77 additions and 61 deletions

View File

@@ -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)