Skip to content

Commit

Permalink
Update backends.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Apr 28, 2020
1 parent 28cb731 commit 57dd319
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/backends.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ abstract type AbstractBackend end
struct CURL <: AbstractBackend end
nameof(::CURL) = "cURL"

function download(::CURL, url, filename; verbose::Bool = false)
function download(::CURL, url, filename; verbose::Bool=false)
curl = Sys.which("curl")
curl === nothing && error("The `curl` executable was not found.")
try
Expand All @@ -28,7 +28,7 @@ end
struct Wget <: AbstractBackend end
nameof(::Wget) = "wget"

function download(::Wget, url, filename; verbose::Bool = false)
function download(::Wget, url, filename; verbose::Bool=false)
wget = Sys.which("wget")
wget === nothing && error("The `wget` executable was not found.")
try
Expand All @@ -52,12 +52,12 @@ nameof(::Http) = "HTTP.jl"

const HEADERS = ["User-Agent" => "RemoteFiles.jl/0.3 (+https://github.com/helgee/RemoteFiles.jl)", "Accept" => "*/*"]

function download(::Http, url, filename; verbose::Bool = false)
function download(::Http, url, filename; verbose::Bool=false)
try
if verbose
HTTP.download(url, filename, HEADERS)
else
HTTP.download(url, filename, HEADERS; update_period = typemax(Int))
HTTP.download(url, filename, HEADERS; update_period=typemax(Int))
end
catch err
throw(DownloadError((sprint(showerror, err))))
Expand Down

0 comments on commit 57dd319

Please sign in to comment.