fix: avoid cc2 generator dirs on missing source (#3178)

This commit is contained in:
Bellman
2026-05-28 10:07:38 +09:00
committed by GitHub
parent d4e9829329
commit 60f44d314b

View File

@@ -503,12 +503,12 @@ def main() -> int:
args = parser.parse_args()
repo_root = args.repo_root.resolve()
out_dir = args.out_dir or (repo_root / ".omx" / "cc2")
out_dir.mkdir(parents=True, exist_ok=True)
try:
board = build_board(repo_root)
except FileNotFoundError as exc:
print(f"error: {exc}", file=sys.stderr)
return 1
out_dir.mkdir(parents=True, exist_ok=True)
board_json = out_dir / "board.json"
board_md = out_dir / "board.md"
board_json.write_text(json.dumps(board, indent=2, sort_keys=True) + "\n", encoding="utf-8")