mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 17:24:46 +00:00
Merge pull request #85 from Iambecomeroot/feature_normalize_path
Normalize paths when linking
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user