Skip to content

Commit

Permalink
fix: Allow for shutil.copytree to have existing dirs
Browse files Browse the repository at this point in the history
* Add dirs_exist_ok=True to allow the copying operation to continue if
  it encounters existing directories.
   - c.f. https://docs.python.org/3.12/library/shutil.html#shutil.copytree
   - dirs_exist_ok was added in Python 3.8.
* Amends PR 155.
  • Loading branch information
matthewfeickert committed Jun 17, 2024
1 parent caa0f1b commit 1cb2f61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/recastatlas/subcommands/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def check(name):
@click.argument("path")
def create(name, path):
template_path = files("recastatlas") / "data/templates/helloworld"
shutil.copytree(template_path, path)
shutil.copytree(template_path, path, dirs_exist_ok=True)
recast_file = os.path.join(path, "recast.yml")
data = string.Template(open(recast_file).read()).safe_substitute(
name=name, author=getpass.getuser()
Expand Down

0 comments on commit 1cb2f61

Please sign in to comment.