Skip to content

Commit

Permalink
Fully spell out the network command options (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmag authored Dec 12, 2023
1 parent 63f8d3a commit 8f28316
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/xla.ex
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ defmodule XLA do
defp download(url, dest) do
command =
case network_tool() do
:curl -> "curl --fail -L -o #{dest} #{curl_options()} #{url}"
:wget -> "wget -O #{dest} #{wget_options()} #{url}"
:curl -> "curl --fail --location --output #{dest} #{curl_options()} #{url}"
:wget -> "wget --output-document=#{dest} #{wget_options()} #{url}"
end

case System.shell(command) do
Expand All @@ -257,8 +257,8 @@ defmodule XLA do
defp get(url) do
command =
case network_tool() do
:curl -> "curl --fail --silent -L #{curl_options()} #{url}"
:wget -> "wget -q -O - #{wget_options()} #{url}"
:curl -> "curl --fail --silent --location #{curl_options()} #{url}"
:wget -> "wget --quiet --output-document=- #{wget_options()} #{url}"
end

case System.shell(command) do
Expand Down Expand Up @@ -289,7 +289,7 @@ defmodule XLA do

defp curl_options() do
headers = http_headers()
Enum.map_join(headers, " ", &"-H '#{&1}'")
Enum.map_join(headers, " ", &"--header '#{&1}'")
end

defp wget_options() do
Expand Down

0 comments on commit 8f28316

Please sign in to comment.