Skip to content

Commit 9dd44ff

Browse files
committed
Clear scripts/news/next after generating version changelog
1 parent 5440573 commit 9dd44ff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/news/__main__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def cli_build_news(ctx: click.Context, version: str, force: bool, template: str)
218218
date = datetime.now(timezone.utc).strftime("%Y-%m-%d")
219219

220220
if not filenames:
221-
err(f"No news fragments found. Exiting")
221+
err("No news fragments found. Exiting")
222222
ctx.exit()
223223
else:
224224
for filename in filenames:
@@ -261,6 +261,12 @@ def cli_build_news(ctx: click.Context, version: str, force: bool, template: str)
261261

262262
out(f"All done! ✨ 🍰 ✨ Created changelog at {changelog_path}")
263263

264+
files = Path(Path.cwd(), "scripts/news/next")
265+
for news_fragment in files.glob("*.md"):
266+
os.remove(news_fragment)
267+
268+
out("🍰 Cleared existing `scripts/news/next` changelogs!")
269+
264270

265271
if __name__ == "__main__":
266272
cli_main()

0 commit comments

Comments
 (0)