@@ -7,7 +7,7 @@ import nimblepkg/[version, cli]
77when defined (curl):
88 import libcurl except Version
99
10- import cliparams, common, utils
10+ import cliparams, common, utils, switcher
1111# import telemetry
1212
1313const
@@ -28,6 +28,35 @@ const # Windows-only
2828const
2929 progressBarLength = 50
3030
31+
32+ proc getNightliesUrl (parsedContents: JsonNode , arch: int ): (string , string ) =
33+ let os =
34+ when defined (windows): " windows"
35+ elif defined (linux): " linux"
36+ elif defined (macosx): " osx"
37+ elif defined (freebsd): " freebsd"
38+ for jn in parsedContents.getElems ():
39+ if jn[" name" ].getStr ().contains (" devel" ):
40+ let tagName = jn{" tag_name" }.getStr (" " )
41+ for asset in jn[" assets" ].getElems ():
42+ let aname = asset[" name" ].getStr ()
43+ let url = asset{" browser_download_url" }.getStr (" " )
44+ if os in aname:
45+ when not defined (macosx):
46+ if " x" & $ arch in aname:
47+ result = (url, tagName)
48+ else :
49+ if isAppleSilicon ():
50+ if " arm64" in aname:
51+ result = (url, tagName)
52+ else :
53+ if " amd64" in aname:
54+ result = (url, tagName)
55+ if result [0 ].len != 0 :
56+ break
57+ if result [0 ].len != 0 :
58+ break
59+
3160proc showIndeterminateBar (progress, speed: BiggestInt , lastPos: var int ) =
3261 try :
3362 eraseLine ()
0 commit comments