finish tool can use 'nimgrab' tool to download the mingw version
This commit is contained in:
parent
51ece61f03
commit
7d1a96151c
4 changed files with 27 additions and 2 deletions
17
tools/nimgrab.nim
Normal file
17
tools/nimgrab.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
import os, asyncdispatch, httpclient
|
||||
|
||||
proc syncDownload(url, file: string) =
|
||||
var client = newHttpClient()
|
||||
proc onProgressChanged(total, progress, speed: BiggestInt) =
|
||||
echo "Downloading " & url & " " & $(speed div 1000) & "kb/s"
|
||||
echo clamp(int(progress*100 div total), 0, 100), "%"
|
||||
|
||||
client.onProgressChanged = onProgressChanged
|
||||
client.downloadFile(url, file)
|
||||
echo "100%"
|
||||
|
||||
if os.paramCount() != 2:
|
||||
quit "Usage: nimgrab <url> <file>"
|
||||
else:
|
||||
syncDownload(os.paramStr(1), os.paramStr(2))
|
||||
Loading…
Add table
Add a link
Reference in a new issue