Resolve Windows symlinks correctly
On Windows, `os.readlink(path)` returns UNC paths that start with `\\?\`. The UNC prefix can be removed when running on Windows. Fixes #307
This commit is contained in:
parent
5f6d060fd2
commit
41778119a4
|
@ -196,7 +196,10 @@ class Link(dotbot.Plugin):
|
||||||
Returns the destination of the symbolic link.
|
Returns the destination of the symbolic link.
|
||||||
"""
|
"""
|
||||||
path = os.path.expanduser(path)
|
path = os.path.expanduser(path)
|
||||||
return os.readlink(path)
|
path = os.readlink(path)
|
||||||
|
if sys.platform[:5] == "win32" and path[:4] == "\\\\?\\":
|
||||||
|
return path[4:]
|
||||||
|
return path
|
||||||
|
|
||||||
def _exists(self, path):
|
def _exists(self, path):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue