Skip to content

Commit 8c77828

Browse files
authored
utils.py: read_file - use parent instead of cwd
1 parent 2b21e42 commit 8c77828

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

infrahub_sdk/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ def write_to_file(path: Path, value: Any) -> bool:
353353

354354
def read_file(file_path: Path) -> str:
355355
if not file_path.is_file():
356-
raise FileNotValidError(name=str(file_path.name), message=f"{file_path.name}: not found at {file_path.cwd()}")
356+
raise FileNotValidError(
357+
name=str(file_path.name), message=f"{file_path.name}: not found at {file_path.parent}"
358+
)
357359
try:
358360
with Path.open(file_path, encoding="utf-8") as fobj:
359361
return fobj.read()

0 commit comments

Comments
 (0)