Skip to content

Commit

Permalink
create results folder when writing to it
Browse files Browse the repository at this point in the history
  • Loading branch information
ImogenBits committed Nov 28, 2023
1 parent 996ed00 commit 4d39480
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions algobattle/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def run_match(

if save:
out_path = config.project.results.joinpath(f"match-{timestamp()}.json")
config.project.results.mkdir(parents=True, exist_ok=True)
out_path.write_text(result.format(error_detail=config.project.error_detail))
console.print("Saved match result to ", out_path)
return result
Expand Down Expand Up @@ -464,6 +465,7 @@ async def sol_builder() -> Solver:

if all_errors:
err_path = config.project.results.joinpath(f"test-{timestamp()}.json")
config.project.results.mkdir(parents=True, exist_ok=True)
err_path.write_text(json.dumps(all_errors, indent=4))
console.print(f"You can find detailed error messages at {err_path}")
return "error"
Expand Down

0 comments on commit 4d39480

Please sign in to comment.