From 2be81614a9851ec13547bffcfe73c20fec6f7708 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 16 Jul 2019 22:17:32 -0500 Subject: Fix #42 - curl should follow redirects, powershell wget backport --- src/nimgen/external.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nimgen/external.nim b/src/nimgen/external.nim index 8656147..cc7a5e8 100644 --- a/src/nimgen/external.nim +++ b/src/nimgen/external.nim @@ -43,9 +43,10 @@ proc downloadUrl*(url: string) = file = url.extractFilename() ext = file.splitFile().ext.toLowerAscii() - var cmd = "curl $# -o $#" - if defined(Windows): - cmd = "powershell wget $# -OutFile $#" + var cmd = if defined(Windows): + "powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget $# -OutFile $#" + else: + "curl -L $# -o $#" if not (ext == ".zip" and fileExists(gOutput/file)): echo "Downloading " & file -- cgit v1.2.3