Skip to content

Commit

Permalink
fix: accept all alternative extentions for copier.yaml (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Nov 1, 2023
1 parent c9f5e3f commit 94ed9b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pytest_copie/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def copy(
"""
# set the template dir and the associated copier.yaml file
template_dir = template_dir or self.default_template_dir
copier_yaml = template_dir / "copier.yaml"
files = template_dir.glob("copier.*")
try:
copier_yaml = next(f for f in files if f.suffix in [".yaml", ".yml"])
except StopIteration:
raise FileNotFoundError("No copier.yaml configuration file found.")

# create a new output_dir in the test dir based on the counter value
(output_dir := self.test_dir / f"copie{self.counter:03d}").mkdir()
Expand Down

0 comments on commit 94ed9b0

Please sign in to comment.