|
@@ -3,6 +3,7 @@
|
|
|
import argparse
|
|
|
import configparser
|
|
|
import dataclasses
|
|
|
+import hashlib
|
|
|
import os
|
|
|
import pathlib
|
|
|
import string
|
|
@@ -112,6 +113,16 @@ def main() -> None:
|
|
|
try:
|
|
|
t = BracedTemplate(template_file.read_text())
|
|
|
output = t.substitute(result_values)
|
|
|
+
|
|
|
+ if output_file.exists():
|
|
|
+ output_existing = output_file.read_text()
|
|
|
+ if (
|
|
|
+ hashlib.sha256(output.encode("utf8")).digest()
|
|
|
+ == hashlib.sha256(output_existing.encode("utf8")).digest()
|
|
|
+ ):
|
|
|
+ print("- Output file unchanged; skipping file write")
|
|
|
+ continue
|
|
|
+
|
|
|
output_file.write_text(output)
|
|
|
print("- All checks passed; wrote output file")
|
|
|
except Exception as e:
|