mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-15 11:40:06 +00:00
do not shadow negative ignore pattern
This commit is contained in:
@@ -117,10 +117,10 @@ class Updater:
|
|||||||
ignore_missing_in_dotdrop = self.ignore_missing_in_dotdrop or \
|
ignore_missing_in_dotdrop = self.ignore_missing_in_dotdrop or \
|
||||||
dotfile.ignore_missing_in_dotdrop
|
dotfile.ignore_missing_in_dotdrop
|
||||||
|
|
||||||
if (ignore_missing_in_dotdrop and not os.path.exists(local_path)) or \
|
if ignore_missing_in_dotdrop and not os.path.exists(local_path):
|
||||||
self._must_ignore([deployed_path, local_path], ignores):
|
|
||||||
self.log.sub(f'\"{dotfile.key}\" ignored')
|
self.log.sub(f'\"{dotfile.key}\" ignored')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# apply write transformation if any
|
# apply write transformation if any
|
||||||
new_path = self._apply_trans_w(deployed_path, dotfile)
|
new_path = self._apply_trans_w(deployed_path, dotfile)
|
||||||
if not new_path:
|
if not new_path:
|
||||||
@@ -261,9 +261,6 @@ class Updater:
|
|||||||
deployed_path = os.path.expanduser(deployed_path)
|
deployed_path = os.path.expanduser(deployed_path)
|
||||||
local_path = os.path.expanduser(local_path)
|
local_path = os.path.expanduser(local_path)
|
||||||
|
|
||||||
if self._must_ignore([deployed_path, local_path], ignores):
|
|
||||||
self.log.sub(f'\"{local_path}\" ignored')
|
|
||||||
return True
|
|
||||||
# find the differences
|
# find the differences
|
||||||
diff = filecmp.dircmp(deployed_path, local_path, ignore=None)
|
diff = filecmp.dircmp(deployed_path, local_path, ignore=None)
|
||||||
# handle directories diff
|
# handle directories diff
|
||||||
@@ -283,8 +280,7 @@ class Updater:
|
|||||||
continue
|
continue
|
||||||
# match to dotdrop dotpath
|
# match to dotdrop dotpath
|
||||||
new = os.path.join(right, toadd)
|
new = os.path.join(right, toadd)
|
||||||
if (ignore_missing_in_dotdrop and not os.path.exists(new)) or \
|
if ignore_missing_in_dotdrop and not os.path.exists(new):
|
||||||
self._must_ignore([exist, new], ignores):
|
|
||||||
self.log.sub(f'\"{exist}\" ignored')
|
self.log.sub(f'\"{exist}\" ignored')
|
||||||
continue
|
continue
|
||||||
if self.dry:
|
if self.dry:
|
||||||
@@ -403,8 +399,6 @@ class Updater:
|
|||||||
"""Synchronize directories recursively."""
|
"""Synchronize directories recursively."""
|
||||||
left, right = diff.left, diff.right
|
left, right = diff.left, diff.right
|
||||||
self.log.dbg(f'sync dir {left} to {right}')
|
self.log.dbg(f'sync dir {left} to {right}')
|
||||||
if self._must_ignore([left, right], ignores):
|
|
||||||
return True
|
|
||||||
|
|
||||||
ignore_missing_in_dotdrop = self.ignore_missing_in_dotdrop or \
|
ignore_missing_in_dotdrop = self.ignore_missing_in_dotdrop or \
|
||||||
dotfile.ignore_missing_in_dotdrop
|
dotfile.ignore_missing_in_dotdrop
|
||||||
|
|||||||
Reference in New Issue
Block a user