Fix #42 - curl should follow redirects, powershell wget backport
This commit is contained in:
parent
39f5f320a6
commit
2be81614a9
1 changed files with 4 additions and 3 deletions
|
|
@ -43,9 +43,10 @@ proc downloadUrl*(url: string) =
|
||||||
file = url.extractFilename()
|
file = url.extractFilename()
|
||||||
ext = file.splitFile().ext.toLowerAscii()
|
ext = file.splitFile().ext.toLowerAscii()
|
||||||
|
|
||||||
var cmd = "curl $# -o $#"
|
var cmd = if defined(Windows):
|
||||||
if defined(Windows):
|
"powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget $# -OutFile $#"
|
||||||
cmd = "powershell wget $# -OutFile $#"
|
else:
|
||||||
|
"curl -L $# -o $#"
|
||||||
|
|
||||||
if not (ext == ".zip" and fileExists(gOutput/file)):
|
if not (ext == ".zip" and fileExists(gOutput/file)):
|
||||||
echo "Downloading " & file
|
echo "Downloading " & file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue