mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-10 20:14:16 +00:00
refactoring
This commit is contained in:
@@ -20,7 +20,7 @@ from dotdrop.updater import Updater
|
|||||||
from dotdrop.comparator import Comparator
|
from dotdrop.comparator import Comparator
|
||||||
from dotdrop.importer import Importer
|
from dotdrop.importer import Importer
|
||||||
from dotdrop.utils import get_tmpdir, removepath, \
|
from dotdrop.utils import get_tmpdir, removepath, \
|
||||||
uniq_list, patch_ignores, dependencies_met, \
|
uniq_list, ignores_to_absolute, dependencies_met, \
|
||||||
adapt_workers, check_version, pivot_path
|
adapt_workers, check_version, pivot_path
|
||||||
from dotdrop.linktypes import LinkTypes
|
from dotdrop.linktypes import LinkTypes
|
||||||
from dotdrop.exceptions import YamlException, \
|
from dotdrop.exceptions import YamlException, \
|
||||||
@@ -138,7 +138,7 @@ def _dotfile_compare(opts, dotfile, tmp):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
ignores = list(set(opts.compare_ignore + dotfile.cmpignore))
|
ignores = list(set(opts.compare_ignore + dotfile.cmpignore))
|
||||||
ignores = patch_ignores(ignores, dotfile.dst, debug=opts.debug)
|
ignores = ignores_to_absolute(ignores, dotfile.dst, debug=opts.debug)
|
||||||
|
|
||||||
insttmp = None
|
insttmp = None
|
||||||
if dotfile.template and \
|
if dotfile.template and \
|
||||||
@@ -216,7 +216,7 @@ def _dotfile_install(opts, dotfile, tmpdir=None):
|
|||||||
LOG.dbg(dotfile.prt())
|
LOG.dbg(dotfile.prt())
|
||||||
|
|
||||||
ignores = list(set(opts.install_ignore + dotfile.instignore))
|
ignores = list(set(opts.install_ignore + dotfile.instignore))
|
||||||
ignores = patch_ignores(ignores, dotfile.dst, debug=opts.debug)
|
ignores = ignores_to_absolute(ignores, dotfile.dst, debug=opts.debug)
|
||||||
|
|
||||||
is_template = dotfile.template and Templategen.path_is_template(
|
is_template = dotfile.template and Templategen.path_is_template(
|
||||||
dotfile.src,
|
dotfile.src,
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ def uniq_list(a_list):
|
|||||||
return new
|
return new
|
||||||
|
|
||||||
|
|
||||||
def patch_ignores(ignores, prefix, debug=False):
|
def ignores_to_absolute(ignores, prefix, debug=False):
|
||||||
"""allow relative ignore pattern"""
|
"""allow relative ignore pattern"""
|
||||||
new = []
|
new = []
|
||||||
LOG.dbg(f'ignores before patching: {ignores}', force=debug)
|
LOG.dbg(f'ignores before patching: {ignores}', force=debug)
|
||||||
|
|||||||
Reference in New Issue
Block a user