Merge pull request #6166 from ynput/bugfix/OP-7514_Multiroot-folder-structure

Chore: Fix duplicated project name on create project structure
This commit is contained in:
Jakub Trllo 2024-01-25 15:01:31 +01:00 committed by GitHub
commit 0e6b351ec5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,13 +28,20 @@ def concatenate_splitted_paths(split_paths, anatomy):
# backward compatibility
if "__project_root__" in path_items:
for root, root_path in anatomy.roots.items():
if not os.path.exists(str(root_path)):
log.debug("Root {} path path {} not exist on \
computer!".format(root, root_path))
if not root_path or not os.path.exists(str(root_path)):
log.debug(
"Root {} path path {} not exist on computer!".format(
root, root_path
)
)
continue
clean_items = ["{{root[{}]}}".format(root),
r"{project[name]}"] + clean_items[1:]
output.append(os.path.normpath(os.path.sep.join(clean_items)))
root_items = [
"{{root[{}]}}".format(root),
"{project[name]}"
]
root_items.extend(clean_items[1:])
output.append(os.path.normpath(os.path.sep.join(root_items)))
continue
output.append(os.path.normpath(os.path.sep.join(clean_items)))