1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 17:24:46 +00:00
This commit is contained in:
deadc0de6
2022-05-21 23:18:26 +02:00
committed by deadc0de
parent 04abcb4710
commit 93025eae37
3 changed files with 8 additions and 3 deletions

View File

@@ -324,11 +324,16 @@ class CfgYaml:
def add_dotfile_to_profile(self, dotfile_key, profile_key): def add_dotfile_to_profile(self, dotfile_key, profile_key):
"""add an existing dotfile key to a profile_key""" """add an existing dotfile key to a profile_key"""
# create the profile if it doesn't exist
self._new_profile(profile_key) self._new_profile(profile_key)
profile = self._yaml_dict[self.key_profiles][profile_key] profile = self.profiles[profile_key]
# ensure profile dotfiles list is not None
if self.key_profile_dotfiles not in profile or \ if self.key_profile_dotfiles not in profile or \
profile[self.key_profile_dotfiles] is None: profile[self.key_profile_dotfiles] is None:
profile[self.key_profile_dotfiles] = [] profile[self.key_profile_dotfiles] = []
# add to the profile
pdfs = profile[self.key_profile_dotfiles] pdfs = profile[self.key_profile_dotfiles]
if self.key_all not in pdfs and \ if self.key_all not in pdfs and \
dotfile_key not in pdfs: dotfile_key not in pdfs:

View File

@@ -115,7 +115,7 @@ class Importer:
self.log.err('importing \"{}\" failed!'.format(path)) self.log.err('importing \"{}\" failed!'.format(path))
return -1 return -1
if self._already_exists(path, dst): if self._already_exists(src, dst):
return -1 return -1
self.log.dbg('import dotfile: src:{} dst:{}'.format(src, dst)) self.log.dbg('import dotfile: src:{} dst:{}'.format(src, dst))

View File

@@ -107,7 +107,7 @@ echo '----------'
cat ${cfg2} cat ${cfg2}
cnt=$(cd ${ddpath} | ${bin} files -G -c ${cfg} -p p1 | grep '^f_def' | wc -l) cnt=$(cd ${ddpath} | ${bin} files -G -c ${cfg} -p p1 | grep '^f_def' | wc -l)
[ "${cnt}" != "1" ] && echo "imported twice!" && exit 1 [ "${cnt}" != "1" ] && echo "imported twice! (${cnt})" && exit 1
echo "OK" echo "OK"
exit 0 exit 0