diff options
Diffstat (limited to 'src/feature/syncinfo.nim')
-rw-r--r-- | src/feature/syncinfo.nim | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/feature/syncinfo.nim b/src/feature/syncinfo.nim index 4f758fe..9dd1331 100644 --- a/src/feature/syncinfo.nim +++ b/src/feature/syncinfo.nim @@ -131,7 +131,14 @@ proc handleSyncInfo*(args: seq[Argument], config: Config): int = let padding = pacmanInfoStrings.map(s => s.trp).computeMaxLength let pkgInfosTable = pkgInfos.map(i => (i.rpc.toPackageReference, i)).toTable - let codes = code & lc[handleTarget(config, padding, finalArgs, x, - x.rpcInfo.map(i => pkgInfosTable.opt(i.toPackageReference)).flatten) | - (x <- fullTargets), int] + when NimVersion >= "1.2": + let codes = block: + let tmp = collect(newSeq): + for x in fullTargets: + handleTarget(config, padding, finalArgs, x, x.rpcInfo.map(i => pkgInfosTable.opt(i.toPackageReference)).flatten) + code & tmp + else: + let codes = code & lc[handleTarget(config, padding, finalArgs, x, + x.rpcInfo.map(i => pkgInfosTable.opt(i.toPackageReference)).flatten) | + (x <- fullTargets), int] codes.filter(c => c != 0).optFirst.get(0) |