Fix pr comments

This commit is contained in:
JCW
2026-03-31 16:38:33 +01:00
parent 96fdc711c0
commit df39ac33d2

View File

@@ -27,6 +27,9 @@ def compute_combined_hash(input_files: list[str]) -> str:
"""
parts = []
for filepath in input_files:
if not Path(filepath).exists():
print(f"Error: input file not found: {filepath}", file=sys.stderr)
sys.exit(1)
file_hash = hashlib.sha256(Path(filepath).read_bytes()).hexdigest()
parts.append(file_hash)
@@ -39,7 +42,7 @@ def read_stamp_hash(stamp_file: str) -> str:
path = Path(stamp_file)
if not path.exists():
return ""
for line in path.read_text().splitlines():
for line in path.read_text(encoding="utf-8").splitlines():
if line.startswith("COMBINED_HASH="):
return line.split("=", 1)[1]
return ""
@@ -67,7 +70,7 @@ def main():
sys.exit(1)
# --update
with open(stamp_file, "w") as fp:
with open(stamp_file, "w", encoding="utf-8") as fp:
fp.write(
"# Auto-generated by protocol autogen - do not edit manually.\n"
"# This file tracks input hashes to avoid unnecessary code regeneration.\n"