Skip to content

Commit

Permalink
ls raises error if passed a file
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum committed Jul 19, 2023
1 parent efa543a commit 6c26cf7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/dvc_data/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ def ls(self, path, detail=True, **kwargs):
try:
info = self.index.info(root_key)
if info["type"] != "directory":
if detail:
info["name"] = path
return [info]
else:
return [path]
raise NotADirectoryError(path)

if not detail:
return [
Expand Down

0 comments on commit 6c26cf7

Please sign in to comment.