Skip to content

Commit

Permalink
fix: cli repo arg
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 6, 2024
1 parent cb1a26e commit e66a760
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sphinx_ape/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,23 @@ def test(base_path):

@cli.command()
@click.argument("base_path", type=Path)
@click.option("--repo", "--repository", help="Specify the repository ID")
@click.option(
"--repo",
"--repository",
help="Specify the repository ID",
)
@click.option(
"--skip-push",
is_flag=True,
hidden=True,
)
def publish(base_path, repository, skip_push):
def publish(base_path, repo, skip_push):
"""
Publish docs
"""
builder = _create_builder(base_path=base_path)
try:
builder.publish(repository=repository, push=not skip_push)
builder.publish(repository=repo, push=not skip_push)
except ApeDocsPublishError as err:
click.echo(f"ERROR: {err}", err=True)
sys.exit(1)
Expand Down
5 changes: 5 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ def test_build_from_pr(runner, cli):
result = runner.invoke(cli, ("build", ".", "--mode", "pull_request"))
assert result.exit_code == 0
assert "Building 'sphinx-ape' 'LATEST'" in result.output


def test_publish(runner, cli):
result = runner.invoke(cli, ("publish", ".", "--skip-push"))
assert result.exit_code == 0

0 comments on commit e66a760

Please sign in to comment.