diff --git a/src/jmteb/__main__.py b/src/jmteb/__main__.py index ab7a234..ff10884 100644 --- a/src/jmteb/__main__.py +++ b/src/jmteb/__main__.py @@ -98,14 +98,16 @@ def main( raise ValueError("No evaluator is selected. Please check the config file or the command line arguments.") # save config as yaml - parser.save( - args, - Path(args.save_dir) / "jmteb_config.yaml", - format="yaml", - overwrite=True, - multifile=False, - skip_check=True, - ) + if args.save_dir: + Path(args.save_dir).mkdir(parents=True, exist_ok=True) + parser.save( + args, + Path(args.save_dir) / "jmteb_config.yaml", + format="yaml", + overwrite=True, + multifile=False, + skip_check=True, + ) args = parser.instantiate_classes(args) if isinstance(args.evaluators, str): diff --git a/tests/test_main.py b/tests/test_main.py index ee81fb5..40de1a3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -31,5 +31,5 @@ def test_main_cli(): # fmt: on result = subprocess.run(command) assert result.returncode == 0 - + assert (Path(f) / "jmteb_config.yaml").exists() assert (Path(f) / "summary.json").exists()