diff options
| author | Yuval Adam <_@yuv.al> | 2022-11-17 00:35:42 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2022-11-17 15:38:21 +0200 |
| commit | f9229cf066eb810a97b3b324527e42d5acba254d (patch) | |
| tree | d6f592695e4e00179e04182d015a240d341ecc16 /scripts | |
| parent | bcf0ce69c5ae552797f4daf30214fab446c61d14 (diff) | |
Split list and render candidates
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/ghpr.py | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/scripts/ghpr.py b/scripts/ghpr.py index 4406ba1..6c9f7f9 100644 --- a/scripts/ghpr.py +++ b/scripts/ghpr.py @@ -11,15 +11,25 @@ with open(path, "r") as f: for line in f: l = line.strip().split(",") domain, handle, name = [x.strip() for x in l] + handle = None if "@" in handle else handle fn = domain.replace(".", "") - with open(ROOT_PATH / "names" / f"{fn}.yml", "w") as out: - s = f"domain: {domain}\nname: {name}\ngithub: {handle}\n" + + path = ROOT_PATH / "names" / f"{fn}.yml" + if path.exists(): + print(f"{domain} already exists") + continue + + with open(path, "w") as out: + s = f"domain: {domain}\nname: {name}\n" + if handle: + s += f"github: {handle}\n" + s += "candidate: true\n" out.write(s) - run(["git", "checkout", "-b", domain]) - run(["git", "add", f"names/{fn}.yml"]) - run(["git", "commit", "-m", f"Add {domain}"]) - run(["git", "push", "-u", "origin", domain]) - run(["gh", "pr", "create", "-t", f"Add {domain}", "-b", f"Hey @{handle}, would you like to merge this PR adding you to https://namehack.club?"]) - run(["git", "checkout", "main"]) + # run(["git", "checkout", "-b", domain]) + # run(["git", "add", f"names/{fn}.yml"]) + # run(["git", "commit", "-m", f"Add {domain}"]) + # run(["git", "push", "-u", "origin", domain]) + # run(["gh", "pr", "create", "-t", f"Add {domain}", "-b", f"Hey @{handle}, would you like to merge this PR adding you to https://namehack.club?"]) + # run(["git", "checkout", "main"]) |
