Skip to content
Snippets Groups Projects
Commit 1891335d authored by Mayr, Hannes's avatar Mayr, Hannes Committed by Hock, Martin
Browse files

Resolve "publish: Copy src directories correctly"

parent db346d3c
Branches
Tags
2 merge requests!52Create v0.2.2,!44Resolve "publish: Copy src directories correctly"
......@@ -211,7 +211,12 @@ class PublishOptions:
# Copy data to destination folder
for path in self.src_datapaths:
try:
shutil.copytree(path, destination, dirs_exist_ok=True)
_, src_dir_name = os.path.split(path)
# Create new dst directory to include the top level directory of
# the source files. So that copying A to B results in B/A and not only
# the contents of A to B.
new_destination = os.path.join(destination, src_dir_name)
shutil.copytree(path, new_destination, dirs_exist_ok=True)
except NotADirectoryError:
shutil.copy2(path, destination)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment