mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-10 23:09:16 +00:00
Normalize paths when linking
This commit is contained in:
@@ -60,7 +60,8 @@ class Installer:
|
|||||||
def link(self, templater, src, dst, actions=[]):
|
def link(self, templater, src, dst, actions=[]):
|
||||||
"""set src as the link target of dst"""
|
"""set src as the link target of dst"""
|
||||||
self.action_executed = False
|
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):
|
if not os.path.exists(src):
|
||||||
self.log.err('source dotfile does not exist: {}'.format(src))
|
self.log.err('source dotfile does not exist: {}'.format(src))
|
||||||
return []
|
return []
|
||||||
@@ -118,8 +119,10 @@ class Installer:
|
|||||||
os.mkdir(dst)
|
os.mkdir(dst)
|
||||||
|
|
||||||
children = os.listdir(parent)
|
children = os.listdir(parent)
|
||||||
srcs = [os.path.join(parent, child) for child in children]
|
srcs = [os.path.normpath(os.path.join(parent, child))
|
||||||
dsts = [os.path.join(dst, child) for child in children]
|
for child in children]
|
||||||
|
dsts = [os.path.normpath(os.path.join(dst, child))
|
||||||
|
for child in children]
|
||||||
|
|
||||||
for i in range(len(children)):
|
for i in range(len(children)):
|
||||||
src = srcs[i]
|
src = srcs[i]
|
||||||
|
|||||||
Reference in New Issue
Block a user