Skip to content

Commit

Permalink
fix(utils): fix import statements and update path for source director…
Browse files Browse the repository at this point in the history
…y in Copier class
  • Loading branch information
entelecheia committed Jun 15, 2023
1 parent 484835c commit 946976a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/hyfi/utils/copier.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
from pathspec import PathSpec
from pydantic.dataclasses import dataclass

from ..hydra import getcwd
from .tools import Style, printf
from hyfi.utils.env import getcwd
from hyfi.utils.tools import Style, printf


@dataclass()
Expand Down Expand Up @@ -75,7 +75,7 @@ class Copier:
When `True`, show all output.
"""

src_path: Path = field(default=Path("config"))
src_path: Path = field(default=Path("conf"))
dst_path: Path = field(default=Path("."))
filetypes: List = field(default_factory=list)
exclude: List = field(default_factory=list)
Expand Down Expand Up @@ -129,6 +129,13 @@ def run_copy(self):
Walk through the source directory, compare YAML files with the destination
directory, and copy files based on the specified settings.
"""
if not Path(self.src_path).is_dir():
printf(
"ERROR",
f"Source path {self.src_path} does not exist.",
style=Style.DANGER,
)
return
for root, _, files in os.walk(self.src_path):
for filename in files:
if not any(filename.endswith(filetype) for filetype in self.filetypes):
Expand Down

0 comments on commit 946976a

Please sign in to comment.