update the dotfile installed on path
(self, path)
| 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""" |