1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-10 06:19:17 +00:00

implement import --as for #220

This commit is contained in:
deadc0de6
2020-04-11 14:46:10 +02:00
parent 054ba21019
commit 40e970465b
7 changed files with 247 additions and 55 deletions

View File

@@ -61,12 +61,21 @@ class Updater:
if not os.path.lexists(path):
self.log.err('\"{}\" does not exist!'.format(path))
return False
dotfile = self.dotfile_dst_getter(path)
if not dotfile:
dotfiles = self.dotfile_dst_getter(path)
if not dotfiles:
return False
if self.debug:
self.log.dbg('updating {} from path \"{}\"'.format(dotfile, path))
return self._update(path, dotfile)
for dotfile in dotfiles:
if not dotfile:
msg = 'invalid dotfile for update: {}'
self.log.err(msg.format(dotfile.key))
return False
if self.debug:
msg = 'updating {} from path \"{}\"'
self.log.dbg(msg.format(dotfile, path))
if not self._update(path, dotfile):
return False
return True
def update_key(self, key):
"""update the dotfile referenced by key"""