Adds didUpdatePackages global to detect downloads.
This commit is contained in:
parent
37ad951b6e
commit
87008ed99c
1 changed files with 6 additions and 0 deletions
|
|
@ -101,10 +101,16 @@ let babelDir = getHomeDir() / ".babel"
|
||||||
let pkgsDir = babelDir / "pkgs"
|
let pkgsDir = babelDir / "pkgs"
|
||||||
let binDir = babelDir / "bin"
|
let binDir = babelDir / "bin"
|
||||||
let nimVer = getNimrodVersion()
|
let nimVer = getNimrodVersion()
|
||||||
|
var didUpdatePackages = false
|
||||||
|
|
||||||
proc update(url: string = defaultPackageURL) =
|
proc update(url: string = defaultPackageURL) =
|
||||||
|
## Downloads the package list from the specified URL.
|
||||||
|
##
|
||||||
|
## If the download is successful, the global didUpdatePackages is set to
|
||||||
|
## true. Otherwise an exception is raised on error.
|
||||||
echo("Downloading package list from " & url)
|
echo("Downloading package list from " & url)
|
||||||
downloadFile(url, babelDir / "packages.json")
|
downloadFile(url, babelDir / "packages.json")
|
||||||
|
didUpdatePackages = true
|
||||||
echo("Done.")
|
echo("Done.")
|
||||||
|
|
||||||
proc checkInstallFile(pkgInfo: TPackageInfo,
|
proc checkInstallFile(pkgInfo: TPackageInfo,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue