Skip to content
Snippets Groups Projects
Commit c7fb8b7e authored by Hock, Martin's avatar Hock, Martin
Browse files

Merge branch '77-publish-copy-src-directories-correctly' into 'dev'

Resolve "publish: Copy src directories correctly"

See merge request !44
parents a38633aa 1891335d
No related branches found
No related tags found
2 merge requests!52Create v0.2.2,!44Resolve "publish: Copy src directories correctly"
Pipeline #855315 waiting for manual action
......@@ -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