mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 18:34:48 +00:00
require confirmation for rm -r
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user