Skip to content

Commit ce89dbb

Browse files
committed
Fix mockers --input arg
1 parent 793adf1 commit ce89dbb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/py/kaleido/_mocker.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ def _get_jsons_in_paths(path: str | Path) -> list[Path]:
2727
path = Path(path) if isinstance(path, str) else path
2828

2929
if path.is_dir():
30-
return [path / a for a in path.glob("*.json")]
31-
else:
30+
_logger.info(f"Input is path {path}")
31+
return path.glob("*.json")
32+
elif path.is_file():
33+
_logger.info(f"Input is file {path}")
3234
return [path]
35+
else:
36+
raise TypeError("--input must be file or directory")
3337

3438

3539
def _load_figures_from_paths(paths: list[Path]):

0 commit comments

Comments
 (0)