MCPcopy
hub / github.com/deadc0de6/dotdrop / update_path

Method update_path

dotdrop/updater.py:60–80  ·  view source on GitHub ↗

update the dotfile installed on path

(self, path)

Source from the content-addressed store, hash-verified

58 self.log = Logger(debug=self.debug)
59
60 def update_path(self, path):
61 """update the dotfile installed on path"""
62 path = os.path.expanduser(path)
63 if not os.path.lexists(path):
64 self.log.err(f'\"{path}\" does not exist!')
65 return False
66 dotfiles = self.conf.get_dotfile_by_dst(path,
67 profile_key=self.profile_key)
68 if not dotfiles:
69 return False
70 for dotfile in dotfiles:
71 if not dotfile:
72 err = f'invalid dotfile for update: {dotfile.key}'
73 self.log.err(err)
74 return False
75
76 msg = f'updating {dotfile} from path \"{path}\"'
77 self.log.dbg(msg)
78 if not self._update(path, dotfile):
79 return False
80 return True
81
82 def update_key(self, key):
83 """update the dotfile referenced by key"""

Callers 2

_dotfile_updateFunction · 0.95
test_update_pathMethod · 0.95

Calls 4

_updateMethod · 0.95
errMethod · 0.80
get_dotfile_by_dstMethod · 0.80
dbgMethod · 0.80

Tested by 1

test_update_pathMethod · 0.76