mirror of
https://github.com/daylinmorgan/git-server.git
synced 2024-12-22 03:40:44 -06:00
collect
This commit is contained in:
parent
55420d7709
commit
e4db7bae04
1 changed files with 9 additions and 7 deletions
|
@ -8,10 +8,9 @@ curl -L \
|
||||||
]#
|
]#
|
||||||
{.define: ssl.}
|
{.define: ssl.}
|
||||||
import std/[
|
import std/[
|
||||||
httpclient, json,
|
httpclient, json, os, osproc,
|
||||||
os, osproc,
|
options, strformat, strutils,
|
||||||
options, sequtils,
|
sugar
|
||||||
strformat, strutils,
|
|
||||||
]
|
]
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -20,7 +19,7 @@ type
|
||||||
description: string
|
description: string
|
||||||
html_url: string
|
html_url: string
|
||||||
|
|
||||||
template use(client: HttpClient, body: untyped) =
|
template use(client: HttpClient, body: untyped) =
|
||||||
try:
|
try:
|
||||||
body
|
body
|
||||||
finally:
|
finally:
|
||||||
|
@ -85,9 +84,12 @@ when isMainModule:
|
||||||
let
|
let
|
||||||
ghRepos = getGhRepos()
|
ghRepos = getGhRepos()
|
||||||
softRepos = getSoftRepos()
|
softRepos = getSoftRepos()
|
||||||
|
toBeMirrored = collect:
|
||||||
|
for repo in ghRepos:
|
||||||
|
if repo.name in reposList and
|
||||||
|
repo.name notin softRepos:
|
||||||
|
repo
|
||||||
|
|
||||||
let repos = ghRepos.filterIt(it.name in reposList)
|
|
||||||
let toBeMirrored: seq[Repo] = repos.filterIt(it.name notin softRepos)
|
|
||||||
if toBeMirrored.len > 0:
|
if toBeMirrored.len > 0:
|
||||||
for repo in toBeMirrored:
|
for repo in toBeMirrored:
|
||||||
mirrorToSoft(repo, dryrun)
|
mirrorToSoft(repo, dryrun)
|
||||||
|
|
Loading…
Reference in a new issue