fix: do not write a newline to an empty xmllist (#5514)
All checks were successful
continuous-integration/drone/push Build is passing

prevents issues with processing files when there are empty xmllists

issue only shows when building with very few languages

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5514
Co-authored-by: delliott <delliott@fsfe.org>
Co-committed-by: delliott <delliott@fsfe.org>
This commit was merged in pull request #5514.
This commit is contained in:
2025-11-24 08:40:10 +00:00
committed by tobiasd
parent 81a3e665c0
commit 0c8a3b7aca

View File

@@ -99,7 +99,7 @@ def _update_for_base( # noqa: PLR0913
)
update_if_changed(
Path(f"{base.parent}/.{base.name}.xmllist"),
("\n".join(sorted(matching_files)) + "\n"),
"\n".join(sorted(matching_files)) + "\n" if matching_files else "",
)