Skip to content

Commit

Permalink
Add file suffix heuristic back to path creation validator
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeNaccarato committed Jul 26, 2024
1 parent 9f09e06 commit 996f607
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/boilercore/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class CreatePathsModel(DefaultPathsModel):

@field_validator("*", mode="before")
@classmethod
def create_directories(cls, value):
def create_directories(cls, value: PathOrPaths[Path | str]):
"""Create directories associated with each value."""
apply_to_path_or_paths(value, create_directories)
return value
Expand Down Expand Up @@ -172,7 +172,7 @@ def get_types(
def create_directories(path: Path | str) -> None:
"""Create directories."""
path = Path(path)
if path.is_file():
if path.is_file() or path.suffix:
return
path.mkdir(parents=True, exist_ok=True)

Expand Down
2 changes: 1 addition & 1 deletion submodules/template

0 comments on commit 996f607

Please sign in to comment.