From 25c4ce7faf1610cc9926d0da8b7430b6686dbf3a Mon Sep 17 00:00:00 2001 From: Katie Wetstone Date: Mon, 24 Oct 2022 10:28:13 -0400 Subject: [PATCH] pass along dirs_exist_ok for local destinations --- cloudpathlib/cloudpath.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloudpathlib/cloudpath.py b/cloudpathlib/cloudpath.py index 7b71e3c5..98c6d55d 100644 --- a/cloudpathlib/cloudpath.py +++ b/cloudpathlib/cloudpath.py @@ -813,7 +813,7 @@ def copytree( else: ignored_names = set() - destination.mkdir(parents=True, exist_ok=True) + destination.mkdir(parents=True, exist_ok=dirs_exist_ok) for subpath in contents: if subpath.name in ignored_names: @@ -826,6 +826,7 @@ def copytree( subpath.copytree( destination / subpath.name, force_overwrite_to_cloud=force_overwrite_to_cloud, + dirs_exist_ok=dirs_exist_ok, ignore=ignore, )