1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-09 07:44:16 +00:00

fix link bug in config #88

This commit is contained in:
deadc0de6
2019-02-19 07:24:36 +01:00
parent a4fa4df920
commit 1d5dd23b86

View File

@@ -144,7 +144,7 @@ class Cfg:
def _load_file(self): def _load_file(self):
"""load the yaml file""" """load the yaml file"""
with open(self.cfgpath, 'r') as f: with open(self.cfgpath, 'r') as f:
self.content = yaml.load(f) self.content = yaml.safe_load(f)
if not self._is_valid(): if not self._is_valid():
return False return False
return self._parse() return self._parse()
@@ -565,9 +565,12 @@ class Cfg:
self.key_dotfiles_dst: dotfile.dst, self.key_dotfiles_dst: dotfile.dst,
self.key_dotfiles_src: dotfile.src, self.key_dotfiles_src: dotfile.src,
} }
if link != LinkTypes.NOLINK:
# set the link flag # set the link flag
dots[dotfile.key][self.key_dotfiles_link] = link if link == LinkTypes.PARENTS:
dots[dotfile.key][self.key_dotfiles_link] = True
elif link == LinkTypes.CHILDREN:
dots[dotfile.key][self.key_dotfiles_link_children] = True
# link it to this profile in the yaml file # link it to this profile in the yaml file
pro = self.content[self.key_profiles][profile] pro = self.content[self.key_profiles][profile]