Skip to content

Commit

Permalink
Merge pull request #100 from nextstrain/s3-download-usability-fix
Browse files Browse the repository at this point in the history
s3 download: Fix usability when URL is a directory
  • Loading branch information
kairstenfay authored Aug 4, 2020
2 parents 972803c + c4524b9 commit 103d3a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nextstrain/cli/remote/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ def download(url: urllib.parse.ParseResult, local_path: Path, recursively: bool
if recursively:
objects = [ item.Object() for item in bucket.objects.filter(Prefix = path) ]
else:
if not path:
raise UserError(dedent("""\
No file path specified in URL (%s); nothing to download.
Did you mean to use --recursively?
""" % (str(url.geturl()))))

object = bucket.Object(path)
assert_exists(object)

Expand Down

0 comments on commit 103d3a3

Please sign in to comment.