fix: route parent-directory creation through the JSON write try/except
Was leaking unhandled OSError tracebacks when the output's parent path could not be created. Exit code stays 1; user-facing message matches the existing write-failure path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -247,9 +247,9 @@ def _run(input_dir: Path, out_path: Path, *, quiet: bool) -> int:
|
||||
"summary": _build_summary(merged),
|
||||
}
|
||||
|
||||
out_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
tmp = out_path.with_suffix(out_path.suffix + ".tmp")
|
||||
try:
|
||||
out_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with tmp.open("w", encoding="utf-8") as f:
|
||||
json.dump(document, f, ensure_ascii=False, indent=2)
|
||||
f.write("\n")
|
||||
|
||||
Reference in New Issue
Block a user