From 38b8d57df60a1bbca0c3bceab1f356416681e10a Mon Sep 17 00:00:00 2001 From: Marcel Robitaille Date: Sat, 2 Feb 2019 21:02:35 -0400 Subject: [PATCH] Normalize paths when linking --- dotdrop/installer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dotdrop/installer.py b/dotdrop/installer.py index 959514d..09ae259 100644 --- a/dotdrop/installer.py +++ b/dotdrop/installer.py @@ -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]