From 17c0a7f76a3168cd568c33fbad2824da2d702764 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 9 Dec 2022 08:41:32 -0500 Subject: [PATCH] doc: Add date in release notes --- docs/genrelnotes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/genrelnotes.py b/docs/genrelnotes.py index 6873019b6..bad659725 100755 --- a/docs/genrelnotes.py +++ b/docs/genrelnotes.py @@ -20,6 +20,7 @@ import argparse import subprocess import re import shutil +import datetime from pathlib import Path RELNOTE_TEMPLATE = '''--- @@ -73,6 +74,10 @@ def generate(relnotes, to_version, source_dir, output_dir): output.parent.mkdir(exist_ok=True, parents=True) with output.open('w', encoding='utf-8') as ofile: ofile.write(RELNOTE_TEMPLATE.format(title, to_version, title_suffix)) + if not output_dir: + date = datetime.date.today() + date_str = date.strftime("%d %B %Y") + ofile.write(f'Meson {to_version} was released on {date_str}\n') for snippetfile in sorted(Path(source_dir, 'markdown/snippets').glob('*.md')): snippet = snippetfile.read_text(encoding='utf-8') ofile.write(snippet)