Skip to content

Commit afbb187

Browse files
committed
fix(publish-cmd): remove usage strings when error occured
Resolves: python-semantic-release#810
1 parent c841eee commit afbb187

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

semantic_release/cli/commands/publish.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,27 @@ def publish(cli_ctx: CliContextObj, tag: str) -> None:
6969
try:
7070
tag = str(tags_and_versions(repo_tags, translator)[0][0])
7171
except IndexError:
72-
ctx.fail(
72+
click.echo(
7373
str.join(
7474
" ",
7575
[
7676
"No tags found with format",
7777
repr(translator.tag_format),
7878
"couldn't identify latest version",
7979
],
80-
)
80+
),
81+
err=True,
8182
)
83+
ctx.exit(1)
8284

8385
if tag not in {tag.name for tag in repo_tags}:
84-
log.error("Tag '%s' not found in local repository!", tag)
86+
click.echo(f"Tag '{tag}' not found in local repository!", err=True)
8587
ctx.exit(1)
8688

8789
if not isinstance(hvcs_client, RemoteHvcsBase):
88-
log.info(
89-
"Remote does not support artifact upload. Exiting with no action taken..."
90+
click.echo(
91+
"Remote does not support artifact upload. Exiting with no action taken...",
92+
err=True,
9093
)
9194
return
9295

0 commit comments

Comments
 (0)