1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 07:58:48 +00:00

Normalize paths when linking

This commit is contained in:
Marcel Robitaille
2019-02-02 21:02:35 -04:00
parent c8d549d837
commit 38b8d57df6

View File

@@ -60,7 +60,8 @@ class Installer:
def link(self, templater, src, dst, actions=[]):
"""set src as the link target of dst"""
self.action_executed = False
src = os.path.join(self.base, os.path.expanduser(src))
src = os.path.normpath(os.path.join(self.base,
os.path.expanduser(src)))
if not os.path.exists(src):
self.log.err('source dotfile does not exist: {}'.format(src))
return []
@@ -118,8 +119,10 @@ class Installer:
os.mkdir(dst)
children = os.listdir(parent)
srcs = [os.path.join(parent, child) for child in children]
dsts = [os.path.join(dst, child) for child in children]
srcs = [os.path.normpath(os.path.join(parent, child))
for child in children]
dsts = [os.path.normpath(os.path.join(dst, child))
for child in children]
for i in range(len(children)):
src = srcs[i]