Skip to content

Commit

Permalink
relativize url
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan King committed Jan 16, 2024
1 parent aed5480 commit 5d1be8c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hail/python/hailtop/aiotools/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ async def writeline(file: WritableStream, *columns: str):


def relativize_url(folder: str, file: str) -> str:
assert folder[-1] != '/'
return file.removeprefix(folder + '/')
if folder[-1] != '/':
folder = folder + '/'
relative_path = file.removeprefix(folder)
assert relative_path[0] != '/'
return relative_path


async def find_all_copy_pairs(
Expand Down

0 comments on commit 5d1be8c

Please sign in to comment.