MCPcopy Create free account
hub / github.com/OWASP/APTS / restore_original_files

Function restore_original_files

scripts/check_generated_artifacts.py:55–66  ·  view source on GitHub ↗
(original_contents: dict[Path, bytes])

Source from the content-addressed store, hash-verified

53
54
55def restore_original_files(original_contents: dict[Path, bytes]) -> list[str]:
56 restore_errors: list[str] = []
57
58 for path, contents in original_contents.items():
59 try:
60 write_bytes(path, contents)
61 except Exception as exc:
62 restore_errors.append(
63 f"FAILED: Could not restore {display_path(path)} after artifact check: {exc}"
64 )
65
66 return restore_errors
67
68
69def main() -> int:

Callers 3

mainFunction · 0.85

Calls 2

write_bytesFunction · 0.90
display_pathFunction · 0.90

Tested by

no test coverage detected