Skip to content

Commit 66922d2

Browse files
committed
add dot file check
1 parent 79e2791 commit 66922d2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

commit0/cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from commit0.harness.constants import SPLIT, SPLIT_ALL
1313
import subprocess
1414
import yaml
15+
import os
1516

1617
commit0_app = typer.Typer(
1718
no_args_is_help=True,
@@ -89,6 +90,11 @@ def write_commit0_dot_file(dot_file_path: str, config: dict) -> None:
8990

9091

9192
def read_commit0_dot_file(dot_file_path: str) -> dict:
93+
# Check if the file exists before attempting to read it
94+
if not os.path.exists(dot_file_path):
95+
raise FileNotFoundError(
96+
f"The commit0 dot file '{dot_file_path}' does not exist."
97+
)
9298
with open(dot_file_path, "r") as f:
9399
return yaml.load(f, Loader=yaml.FullLoader)
94100

0 commit comments

Comments
 (0)