Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: do not echo 'Removing...' if the files are to be kept #487

Merged
merged 4 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/towncrier/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ def __main(
click.echo("Staging newsfile...", err=to_err)
_git.stage_newsfile(base_directory, news_file)

click.echo("Removing news fragments...", err=to_err)
if should_remove_fragment_files(
umarcor marked this conversation as resolved.
Show resolved Hide resolved
fragment_filenames,
answer_yes,
answer_keep,
):
click.echo("Removing news fragments...", err=to_err)
_git.remove_files(fragment_filenames)

click.echo("Done!", err=to_err)
Expand All @@ -279,6 +279,9 @@ def should_remove_fragment_files(
answer_yes: bool,
answer_keep: bool,
) -> bool:
if not fragment_filenames:
click.echo("No news fragments to remove. Skipping!")
return False
try:
if answer_keep:
click.echo("Keeping the following files:")
Expand Down
1 change: 1 addition & 0 deletions src/towncrier/newsfragments/487.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not echo 'Removing...' if the files are to be kept