Fix "FileExistsError" when "platformio ci" command is used in pair with "--keep-build-dir" option

This commit is contained in:
Ivan Kravets committed 2019-03-14 20:14:55 +02:00
1 parent e37d34b92f
commit 326eb4a681
3 files changed
+38 -3

No files matched your search

+2 -2
View File
@@ -55,7 +55,6 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument
"--build-dir",
default=mkdtemp,
type=click.Path(
exists=True,
file_okay=False,
dir_okay=True,
writable=True,
@@ -134,7 +133,8 @@ def _copy_contents(dst_dir, contents):
if dst_dir_name == "src" and len(items['dirs']) == 1:
copytree(list(items['dirs']).pop(), dst_dir, symlinks=True)
else:
makedirs(dst_dir)
if not isdir(dst_dir):
makedirs(dst_dir)
for d in items['dirs']:
copytree(d, join(dst_dir, basename(d)), symlinks=True)