Skip to content

Commit

Permalink
fix(fetch): use correct header syntax for wget (chipsalliance#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman authored Aug 17, 2022
1 parent ec7c134 commit 496c55e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lua/mason-core/fetch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ local function fetch(url, opts)
return platform_specific
:recover_catching(function()
local headers =
_.sort_by(_.identity, _.map(_.compose(_.format "--header='%s'", _.join ": "), _.to_pairs(opts.headers)))
_.sort_by(_.identity, _.map(_.compose(_.format "--header=%s", _.join ": "), _.to_pairs(opts.headers)))
return spawn
.wget({
headers,
Expand Down
6 changes: 3 additions & 3 deletions tests/mason-core/fetch_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe("fetch", function()
assert.spy(spawn.curl).was_called(1)
assert.spy(spawn.wget).was_called_with {
{
"--header='User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)'",
"--header='X-Custom-Header: here'",
"--header=User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)",
"--header=X-Custom-Header: here",
},
"-nv",
"-O",
Expand Down Expand Up @@ -77,7 +77,7 @@ describe("fetch", function()

assert.spy(spawn.wget).was_called_with {
{
"--header='User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)'",
"--header=User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)",
},
"-nv",
"-O",
Expand Down

0 comments on commit 496c55e

Please sign in to comment.