Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion solvebio/cli/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,9 +746,11 @@ def _download_recursive(

min_depth = min([x.depth for x in remote_objects])
num_at_min_depth = len([x for x in remote_objects if x.depth == min_depth])
if num_at_min_depth == 1:
if num_at_min_depth == 1 and not _is_single_file(remote_objects):
# when downloading from folder
base_folder_depth = min_depth
else:
# when downloading from vault root or singular file
base_folder_depth = min_depth - 1

downloaded_files = set()
Expand Down Expand Up @@ -932,6 +934,10 @@ def _get_relative_download_path(base_path, path_to_object, filename):
return filename


def _is_single_file(objects):
return len(objects) == 1 and objects[0].get("object_type") == "file"


def ls(args):
"""
Given a SolveBio remote path, list the files and folders
Expand Down
Loading