Skip to content

Commit

Permalink
feat(hurl_runner): inject fixture variables and file root into command
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Oct 26, 2024
1 parent ea12015 commit a296ffd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lua/hurl/lib/hurl_runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ function M.run_hurl_verbose(filePath, fromEntry, toEntry, isVeryVerbose)
end
end

-- Inject fixture variables into the command
if _HURL_GLOBAL_CONFIG.fixture_vars then
for _, fixture in pairs(_HURL_GLOBAL_CONFIG.fixture_vars) do
table.insert(args, '--variable')
table.insert(args, fixture.name .. '=' .. fixture.callback())
end
end

-- Add file root for uploads
local file_root = _HURL_GLOBAL_CONFIG.file_root or vim.fn.getcwd()
table.insert(args, '--file-root')
table.insert(args, file_root)

local stdout_data = ''
local stderr_data = ''

Expand Down

0 comments on commit a296ffd

Please sign in to comment.