Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Copier into Walker and Copier steps #294

Merged
merged 11 commits into from
Sep 27, 2024
13 changes: 9 additions & 4 deletions src/ansible_creator/subcommands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ansible_creator.exceptions import CreatorError
from ansible_creator.templar import Templar
from ansible_creator.types import TemplateData
from ansible_creator.utils import Copier
from ansible_creator.utils import Copier, Walker


if TYPE_CHECKING:
Expand Down Expand Up @@ -125,14 +125,19 @@ def _scaffold(self) -> None:
dev_file_name=self.unique_name_in_devfile(),
)

copier = Copier(
resources=[f"{self._project}_project", *self.common_resources],
walker = Walker(
resources=(f"{self._project}_project", *self.common_resources),
resource_id=f"{self._project}_project",
dest=self._init_path,
output=self.output,
templar=self._templar,
template_data=template_data,
)
copier.copy_containers()
paths = walker.collect_paths()

copier = Copier(
output=self.output,
)
copier.copy_containers(paths)

self.output.note(f"{self._project} project created at {self._init_path}")
Loading
Loading