mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
utils/curl: fix flag handling
This commit is contained in:
parent
243794b588
commit
73a1ff82d2
@ -304,7 +304,13 @@ module Utils
|
||||
)
|
||||
file = Tempfile.new.tap(&:close)
|
||||
|
||||
specs = specs.flat_map { |option, argument| ["--#{option.to_s.tr("_", "-")}", argument] }
|
||||
specs = specs.flat_map do |option, argument|
|
||||
next if argument == false # No flag.
|
||||
|
||||
args = ["--#{option.to_s.tr("_", "-")}"]
|
||||
args << argument unless argument == true # It's a flag.
|
||||
args
|
||||
end
|
||||
max_time = hash_needed ? 600 : 25
|
||||
output, _, status = curl_output(
|
||||
*specs, "--dump-header", "-", "--output", file.path, "--location", url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user