Fix running testament c nimble-packages without batch arg (#18023)

* Fix running testament c nimble-packages without batch arg

* Fix
This commit is contained in:
Clyybber
2021-05-17 13:48:10 +02:00
committed by GitHub
parent 8be5344b3b
commit fac5bae7b7

View File

@@ -424,11 +424,12 @@ proc listPackages(packageFilter: string): seq[NimblePackage] =
# at least should be a regex; a substring match makes no sense.
result = pkgs.filterIt(packageFilter in it.name)
else:
let pkgs1 = pkgs.filterIt(it.allowFailure)
let pkgs2 = pkgs.filterIt(not it.allowFailure)
if testamentData0.batchArg == "allowed_failures":
result = pkgs1
result = pkgs.filterIt(it.allowFailure)
elif testamentData0.testamentNumBatch == 0:
result = pkgs
else:
let pkgs2 = pkgs.filterIt(not it.allowFailure)
for i in 0..<pkgs2.len:
if i mod testamentData0.testamentNumBatch == testamentData0.testamentBatch:
result.add pkgs2[i]