Skip to content
Closed
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
19 changes: 17 additions & 2 deletions dvc/remote/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,26 @@ def download(
if to_info.scheme != "local":
raise NotImplementedError

logger.debug("Downloading '{}' to '{}'".format(from_info, to_info))
makedirs(to_info.parent, exist_ok=True, mode=dir_mode)

if self.isdir(from_info):
# need to create dir here
# also pass the individual file name (file and to)
for file_info in self.walk_files(from_info):
self.single_file_download(
file_info, to_info, name, no_progress_bar, file_mode
)
else:
self.single_file_download(
from_info, to_info, name, no_progress_bar, file_mode
)

def single_file_download(
self, from_info, to_info, name, no_progress_bar, file_mode
):
logger.debug("Downloading '{}' to '{}'".format(from_info, to_info))
name = name or to_info.name

makedirs(to_info.parent, exist_ok=True, mode=dir_mode)
tmp_file = tmp_fname(to_info)

try:
Expand Down