mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 07:18:27 +01:00
gs: check if the path is directory when checking for exists
This commit is contained in:
+8
-3
@@ -148,7 +148,7 @@ class RemoteGS(RemoteBASE):
|
||||
return self._list_paths(self.path_info)
|
||||
|
||||
def walk_files(self, path_info):
|
||||
for fname in self._list_paths(path_info):
|
||||
for fname in self._list_paths(path_info / ""):
|
||||
# skip nested empty directories
|
||||
if fname.endswith("/"):
|
||||
continue
|
||||
@@ -165,8 +165,13 @@ class RemoteGS(RemoteBASE):
|
||||
|
||||
def exists(self, path_info):
|
||||
dir_path = path_info / ""
|
||||
fname = next(self._list_paths(path_info, max_items=1), "")
|
||||
return path_info.path == fname or fname.startswith(dir_path.path)
|
||||
|
||||
if self.isdir(dir_path):
|
||||
return True
|
||||
|
||||
for fname in self._list_paths(path_info):
|
||||
if path_info.path == fname:
|
||||
return True
|
||||
|
||||
def _upload(self, from_file, to_info, name=None, no_progress_bar=True):
|
||||
bucket = self.gs.bucket(to_info.bucket)
|
||||
|
||||
Reference in New Issue
Block a user