@@ 38,11 38,13 @@ proc runScripts(pkgDef: BrrrFile, packageVersion: string,
log(logs[0], 2)
proc installPackage(pkg: PkgTuple, pkgDef: BrrrFile): string =
- let logs = execCmdEx(pkgDef.get_tags)
- var tags = logs[0].split("\n").filter(x => x != "")
- tags.sort(semverCmp)
-
- result = tags[tags.len - 1]
+ if pkg.ver != star:
+ result = pkg.ver
+ else:
+ let logs = execCmdEx(pkgDef.get_tags)
+ var tags = logs[0].split("\n").filter(x => x != "")
+ tags.sort(semverCmp)
+ result = tags[tags.len - 1]
let hasVersion = pkgDef.versions.hasKey(result)
let hasStarVersion = pkgDef.versions.hasKey(star)
@@ 61,15 63,15 @@ proc installPackage(pkg: PkgTuple, pkgDef: BrrrFile): string =
raise brrrError("Can't find version")
proc install*(packages: seq[PkgTuple]) =
- let timeStart = now()
- let pkg = packages[0]
- try:
- var (url, pkgDef) = downloadPackageDefinition(pkg)
- let version = installPackage(pkg, pkgDef)
- addPackageToConfig(pkg.name, version, url)
- let timeEnd = now()
- let duration = timeEnd - timeStart
- log($pkg.name & "@" & version & " installed successfully (" & $duration & ")")
- except BrrrError as error:
- log("Error while installing " & $pkg)
- log(error.message, 2)
+ for pkg in packages.items:
+ let timeStart = now()
+ try:
+ var (url, pkgDef) = downloadPackageDefinition(pkg)
+ let version = installPackage(pkg, pkgDef)
+ addPackageToConfig(pkg.name, version, url)
+ let timeEnd = now()
+ let duration = timeEnd - timeStart
+ log($pkg.name & "@" & version & " installed successfully (" & $duration & ")")
+ except BrrrError as error:
+ log("Error while installing " & $pkg)
+ log(error.message, 2)