refactor(lua): use vim.system #34707

This commit is contained in:
Yochem van Rosmalen authored and GitHub committed 2025-07-23 20:03:30 -07:00
1 parent 54b8c99e51
commit 35af766de6
9 files changed
+77 -61

No files matched your search

+3 -2
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)