Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 5df2cbd2 authored by Corey Bryant's avatar Corey Bryant Committed by GitHub
Browse files

Merge pull request #9111 from coreycb/print-all-notes

Print all rendered notes when using --print
parents 8c306733 9a01adb1
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -144,16 +144,17 @@ def render_notes(
        elif render_file == "changelog" or render_file == "changelog_long":
            stripped = rendered.lstrip()
            maxlen = render_files[render_file].get("max_length", float("inf"))
            if print_only:
                print(f"\n==={render_files[render_file]['outfile']}===")
                print(stripped)

            if len(stripped) > maxlen:
                print(
                    f"Error: Maximum length of {maxlen} exceeded, {render_file} is {len(stripped)} characters"
                )
                sys.exit(1)

            if print_only:
                print(f"\n==={render_files[render_file]['outfile']}===")
                print(stripped)
            else:
            if not print_only:
                with open(render_files[render_file]["outfile"], "x") as file:
                    file.write(stripped)