Skip to content

Commit 23fd583

Browse files
committed
Keep vault icon paths POXIX-style
1 parent 50870a3 commit 23fd583

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/vaults/modvault/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def iconPathToFull(moddir: str, iconpath: str) -> str:
123123

124124

125125
def fullPathToIcon(moddir: str, path: str) -> str:
126-
p = os.path.normpath(os.path.abspath(path))
127-
return os.path.join("/mods", p.removeprefix(os.path.normpath(moddir)).lstrip(os.sep))
126+
rel = os.path.relpath(os.path.abspath(path), start=os.path.abspath(moddir))
127+
return f"/mods/{rel.replace(os.sep, '/')}"
128128

129129

130130
def getIcon(name):

0 commit comments

Comments
 (0)