Skip to content

Commit

Permalink
fix: yq parsing for version 4.x (#16)
Browse files Browse the repository at this point in the history
Apparently the depracation warning about `-j` does not get ignored, but
mixed to the output. We have to use `vim.system` instead (Neovim 0.9+).
  • Loading branch information
brablc authored Nov 19, 2024
1 parent 6e16463 commit 07964ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/gh-actions/yaml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ function M.parse_yaml(yamlstr)
if has_rust_module then
return rust.parse_yaml(yamlstr or '')
else
return vim.json.decode(vim.fn.system({ 'yq', '-j' }, yamlstr))
local result = vim
.system({ 'yq', '-j' }, {
stdin = yamlstr,
stderr = false,
})
:wait()
return vim.json.decode(result.stdout)
end
end

Expand Down

0 comments on commit 07964ce

Please sign in to comment.