Skip to content

Commit

Permalink
ensuring that directory blob ends with trailing slash
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsochat@stanford.edu>
  • Loading branch information
vsoch committed Oct 13, 2020
1 parent 7036419 commit 40f5395
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion snakemake/remote/GS.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,15 @@ def upload(self):
f = self.local_file()
if os.path.isdir(f):

# We must ensure ends with / to be treated as directory
upload_blob = (
self.bucket.blob(f)
if f.endswith("/")
else self.bucket.blob(f + "/")
)

# Ensure the "directory" exists
self.blob.upload_from_string(
upload_blob.upload_from_string(
"", content_type="application/x-www-form-urlencoded;charset=UTF-8"
)
for root, _, files in os.walk(f):
Expand Down

0 comments on commit 40f5395

Please sign in to comment.