diff --git a/dotdrop/updater.py b/dotdrop/updater.py index 0880ff1..98fd3b8 100644 --- a/dotdrop/updater.py +++ b/dotdrop/updater.py @@ -137,6 +137,8 @@ class Updater: continue if self.debug: self.log.dbg('rm -r {}'.format(new)) + if not self._confirm_rm_r(new): + continue utils.remove(new) # handle files diff @@ -208,3 +210,10 @@ class Updater: if self.safe and not self.log.ask(msg): return False return True + + def _confirm_rm_r(self, directory): + """ask for rm -r directory""" + msg = 'Recursively remove \"{}\"?'.format(directory) + if self.safe and not self.log.ask(msg): + return False + return True