Skip to content

Commit

Permalink
Fix for win - does it fail on other?
Browse files Browse the repository at this point in the history
  • Loading branch information
weshinsley committed Feb 1, 2025
1 parent 378fd7e commit a1a6b07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/hipercow/dide/mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def remap_path(path: Path, mounts: list[Mount]) -> PathMap:
raise Exception(msg)
mount = pos[0]
relative = path.relative_to(mount.local)
if re.match("^[A-Za-z]:/?$", str(mount.local)):
if re.match("^[A-Za-z]:/?$", str(mount.local).replace("\\", "/")):
remote = mount.local
elif mount.host == "qdrive":
remote = Path("Q:")
Expand Down
1 change: 1 addition & 0 deletions tests/dide/test_mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def test_throw_if_two_plausible_mounts():


def test_preserve_drive_letter_if_given():
drive = "P:"
m = [mounts.Mount("host", Path("/hostmount"), Path("P:"))]
path = Path("P:/local/path")
res = mounts.remap_path(path, m)
Expand Down

0 comments on commit a1a6b07

Please sign in to comment.