fix(library/relative.py): Windows and Linux builds
This commit is contained in:
parent
b0c84874ba
commit
b2ff6bfd9f
1 changed files with 2 additions and 2 deletions
|
|
@ -9,9 +9,9 @@ import re
|
|||
for x in sys.stdin:
|
||||
# HACK: rewrite Windows path to mingw path
|
||||
x = re.sub(r"^(\w):", lambda m: "/" + m[1].lower(), x).replace('\\', '/').strip()
|
||||
curr = os.path.realpath(os.curdir)
|
||||
curr = os.path.normpath(curr)
|
||||
if sys.platform == "darwin":
|
||||
# HACK: macos paths are case insensitive, but Python's normalization does not convert characters to lowercase
|
||||
curr = os.path.realpath(os.curdir)
|
||||
curr = os.path.normpath(curr)
|
||||
curr = curr.lower()
|
||||
print(os.path.relpath(x, curr))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue