mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 10:36:11 +00:00
install() to return single dotfile not flat list
This commit is contained in:
@@ -118,7 +118,6 @@ class Installer:
|
|||||||
srcs = [os.path.join(parent, child) for child in children]
|
srcs = [os.path.join(parent, child) for child in children]
|
||||||
dsts = [os.path.join(dst, child) for child in children]
|
dsts = [os.path.join(dst, child) for child in children]
|
||||||
|
|
||||||
results = []
|
|
||||||
for i in range(len(children)):
|
for i in range(len(children)):
|
||||||
src = srcs[i]
|
src = srcs[i]
|
||||||
dst = dsts[i]
|
dst = dsts[i]
|
||||||
@@ -141,9 +140,7 @@ class Installer:
|
|||||||
if len(result):
|
if len(result):
|
||||||
actions = []
|
actions = []
|
||||||
|
|
||||||
results.append(result)
|
return (src, dst)
|
||||||
|
|
||||||
return utils.flatten(results)
|
|
||||||
|
|
||||||
def _link(self, src, dst, actions=[]):
|
def _link(self, src, dst, actions=[]):
|
||||||
"""set src as a link target of dst"""
|
"""set src as a link target of dst"""
|
||||||
|
|||||||
@@ -113,11 +113,6 @@ def strip_home(path):
|
|||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
def flatten(a):
|
|
||||||
"""flatten list"""
|
|
||||||
return functools.reduce(operator.iconcat, a, [])
|
|
||||||
|
|
||||||
|
|
||||||
def must_ignore(paths, ignores, debug=False):
|
def must_ignore(paths, ignores, debug=False):
|
||||||
"""return true if any paths in list matches any ignore patterns"""
|
"""return true if any paths in list matches any ignore patterns"""
|
||||||
if not ignores:
|
if not ignores:
|
||||||
|
|||||||
Reference in New Issue
Block a user