mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-05-30 03:35:20 +08:00
fix: avoid cc2 generator dirs on missing source (#3178)
This commit is contained in:
parent
d4e9829329
commit
60f44d314b
@ -503,12 +503,12 @@ def main() -> int:
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
repo_root = args.repo_root.resolve()
|
repo_root = args.repo_root.resolve()
|
||||||
out_dir = args.out_dir or (repo_root / ".omx" / "cc2")
|
out_dir = args.out_dir or (repo_root / ".omx" / "cc2")
|
||||||
out_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
try:
|
try:
|
||||||
board = build_board(repo_root)
|
board = build_board(repo_root)
|
||||||
except FileNotFoundError as exc:
|
except FileNotFoundError as exc:
|
||||||
print(f"error: {exc}", file=sys.stderr)
|
print(f"error: {exc}", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
out_dir.mkdir(parents=True, exist_ok=True)
|
||||||
board_json = out_dir / "board.json"
|
board_json = out_dir / "board.json"
|
||||||
board_md = out_dir / "board.md"
|
board_md = out_dir / "board.md"
|
||||||
board_json.write_text(json.dumps(board, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
board_json.write_text(json.dumps(board, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user