diff --git a/solvebio/cli/data.py b/solvebio/cli/data.py index 08b394cc..d46850f6 100644 --- a/solvebio/cli/data.py +++ b/solvebio/cli/data.py @@ -151,8 +151,11 @@ def _upload_folder( for abs_local_parent_path, folders, files in os.walk(base_local_path): # Strips off the local path and adds the parent directory at # each phase of the loop + base_local_path_dirname = os.path.dirname(base_local_path) + if os.name == "nt": + base_local_path_dirname = re.escape(os.path.dirname(base_local_path)) local_parent_path = re.sub( - "^" + os.path.dirname(base_local_path), "", abs_local_parent_path + "^" + base_local_path_dirname, "", abs_local_parent_path ).lstrip("/") if should_exclude(abs_local_parent_path, exclude_paths, dry_run=dry_run): @@ -160,6 +163,9 @@ def _upload_folder( remote_folder_full_path = os.path.join(base_remote_path, local_parent_path) + if os.name == "nt": + remote_folder_full_path = base_remote_path + "/" + local_parent_path.lstrip("\\").replace("\\", "/") + # Create folders for folder in folders: new_folder_path = os.path.join(abs_local_parent_path, folder)