Skip to content

Commit d8620c7

Browse files
Allow repo name to be passed from the CLI. (#11)
2 parents e10e774 + e62995d commit d8620c7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bot/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def print_tree(tree: Tree, parent: Path, depth: int = 0) -> None:
2828
@command()
2929
@option(
3030
"--repo-path",
31-
"--repo",
3231
help="The path to the local git repository.",
3332
type=PathType(
3433
exists=True,
@@ -59,7 +58,6 @@ def read(
5958
@command()
6059
@option(
6160
"--repo-path",
62-
"--repo",
6361
help="The path to the local git repository.",
6462
type=PathType(
6563
exists=True,
@@ -69,6 +67,10 @@ def read(
6967
),
7068
required=True,
7169
)
70+
@option(
71+
"--repo-name",
72+
help="The (fully qualified) name of the GitHub repo.",
73+
)
7274
@option(
7375
"--branch",
7476
help="The remote branch on which to add the generated commit.",
@@ -98,14 +100,15 @@ def write(
98100
app_id: int,
99101
branch: str,
100102
private_key: str,
103+
repo_name: str | None,
101104
repo_path: Path,
102105
ref: str,
103106
) -> None:
104107
"""Read a commit from a local git repo and write it to GitHub."""
105108
basic_config(level=INFO)
106109

107110
repo = read_repo(repo_path)
108-
repo_name = extract_repo_name(repo)
111+
repo_name = repo_name or extract_repo_name(repo)
109112

110113
github = authenticate_app(app_id, private_key)
111114
repository = github.get_repo(repo_name)

0 commit comments

Comments
 (0)