Skip to content

Commit

Permalink
fix precedence for #443
Browse files Browse the repository at this point in the history
  • Loading branch information
deadc0de6 committed Nov 6, 2024
1 parent b53f939 commit e7335ec
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions dotdrop/cfg_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,14 +1096,14 @@ def _import_config(self, path):
]

# merge top entries
self.dotfiles = self._merge_dict(self.dotfiles, sub.dotfiles)
self.profiles = self._merge_dict(self.profiles, sub.profiles,
self.dotfiles = self._merge_dict(sub.dotfiles, self.dotfiles)
self.profiles = self._merge_dict(sub.profiles, self.profiles,
deep=True)
self.actions = self._merge_dict(self.actions, sub.actions)
self.trans_install = self._merge_dict(self.trans_install,
sub.trans_install)
self.trans_update = self._merge_dict(self.trans_update,
sub.trans_update)
self.actions = self._merge_dict(sub.actions, self.actions)
self.trans_install = self._merge_dict(sub.trans_install,
self.trans_install)
self.trans_update = self._merge_dict(sub.trans_update,
self.trans_update)
self._clear_profile_vars(sub.variables)

self.imported_configs.append(path)
Expand Down Expand Up @@ -1693,6 +1693,7 @@ def _merge_dict(cls, high, low, deep=False):
"""
both dict must be the same form/type
if deep is True, then merge recursively
high dict entries take precedence over low dict
"""
if not high:
high = {}
Expand Down

0 comments on commit e7335ec

Please sign in to comment.