diff options
| author | Yuval Adam <_@yuv.al> | 2022-11-26 09:51:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-26 09:51:17 +0200 |
| commit | 7387c7cb3ef89c0227b53a19a8057c35e6aec6e9 (patch) | |
| tree | 7f2cf28cf070aab45266b9950dd7e9b64eb61666 /scripts/ghpr.py | |
| parent | 6d40823ded0bed7c32ebd9747d261f03b09b6893 (diff) | |
| parent | 76583e5aca961cc68eb6d3f8438b1a7d113b1c14 (diff) | |
Merge pull request #57 from yuvadm/candidates
Add mass of candidates
Diffstat (limited to 'scripts/ghpr.py')
| -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"]) |
