mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 14:31:46 +00:00
fix bug
This commit is contained in:
@@ -324,11 +324,16 @@ class CfgYaml:
|
||||
|
||||
def add_dotfile_to_profile(self, dotfile_key, profile_key):
|
||||
"""add an existing dotfile key to a profile_key"""
|
||||
# create the profile if it doesn't exist
|
||||
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 \
|
||||
profile[self.key_profile_dotfiles] is None:
|
||||
profile[self.key_profile_dotfiles] = []
|
||||
|
||||
# add to the profile
|
||||
pdfs = profile[self.key_profile_dotfiles]
|
||||
if self.key_all not in pdfs and \
|
||||
dotfile_key not in pdfs:
|
||||
|
||||
@@ -115,7 +115,7 @@ class Importer:
|
||||
self.log.err('importing \"{}\" failed!'.format(path))
|
||||
return -1
|
||||
|
||||
if self._already_exists(path, dst):
|
||||
if self._already_exists(src, dst):
|
||||
return -1
|
||||
|
||||
self.log.dbg('import dotfile: src:{} dst:{}'.format(src, dst))
|
||||
|
||||
@@ -107,7 +107,7 @@ echo '----------'
|
||||
cat ${cfg2}
|
||||
|
||||
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"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user