Skip to content
Snippets Groups Projects
Commit 71aedf22 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Explicit error if template file is not present.

parent f570c78d
No related branches found
No related tags found
3 merge requests!279v0.4.0,!253v0.4.0,!235Add support for GridSample + Minor changes
...@@ -19,6 +19,8 @@ def generate_file(file_path: Union[Path, str], template_path: Union[Path, str], ...@@ -19,6 +19,8 @@ def generate_file(file_path: Union[Path, str], template_path: Union[Path, str],
file_path = Path(file_path) file_path = Path(file_path)
if isinstance(template_path, str): if isinstance(template_path, str):
template_path = Path(template_path) template_path = Path(template_path)
if not template_path.exists():
raise ValueError(f"Path to template {template_path} is not valid !")
# Make dir # Make dir
file_path.parent.mkdir(parents=True, exist_ok=True) file_path.parent.mkdir(parents=True, exist_ok=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment