From f2116f229387af2d3e367d0078175bdcc50012b1 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 11 Sep 2023 21:01:47 +0200 Subject: [PATCH] uninstall skeleton --- dotdrop/dotdrop.py | 17 +++++++++++++++++ dotdrop/options.py | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index 62fb803..e3cc6dd 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -620,6 +620,17 @@ def cmd_detail(opts): LOG.log('') +def cmd_uninstall(opts): + paths = opts.uninstall_path + iskey = opts.uninstall_iskey + prof = opts.conf.get_profile() + + if not paths: + # is entire profile + # TODO + # TODO + + def cmd_remove(opts): """remove dotfile from dotpath and from config""" paths = opts.remove_path @@ -856,6 +867,12 @@ def _exec_command(opts): LOG.dbg(f'running cmd: {command}') cmd_remove(opts) + elif opts.cmd_uninstall: + # uninstall dotfile + command = 'uninstall' + LOG.dbg(f'running cmd: {command}') + cmd_uninstall(opts) + except UndefinedException as exc: LOG.err(exc) ret = False diff --git a/dotdrop/options.py b/dotdrop/options.py index 98d5f94..3ae68f9 100644 --- a/dotdrop/options.py +++ b/dotdrop/options.py @@ -68,6 +68,7 @@ Usage: dotdrop update [-VbfdkPz] [-c ] [-p ] [-w ] [-i ...] [...] dotdrop remove [-Vbfdk] [-c ] [-p ] [...] + dotdrop uninstall [-Vbfdk] [-c ] [-p ] [...] dotdrop files [-VbTG] [-c ] [-p ] dotdrop detail [-Vb] [-c ] [-p ] [...] dotdrop profiles [-VbG] [-c ] @@ -340,6 +341,11 @@ class Options(AttrMonitor): self.remove_path = self.args[''] self.remove_iskey = self.args['--key'] + def _apply_args_uninstall(self): + """uninstall specifics""" + self.uninstall_path = self.args[''] + self.uninstall_iskey = self.args['--key'] + def _apply_args_detail(self): """detail specifics""" self.detail_keys = self.args[''] @@ -403,6 +409,9 @@ class Options(AttrMonitor): # "remove" specifics self._apply_args_remove() + # "uninstall" specifics + self._apply_args_uninstall() + def _fill_attr(self): """create attributes from conf""" # defined variables