1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-16 07:38:50 +00:00
thefuck/thefuck/rules/rm_root.py

17 lines
401 B
Python

from thefuck.utils import sudo_support
enabled_by_default = False
@sudo_support
def match(command, settings):
return ({'rm', '/'}.issubset(command.script.split())
and '--no-preserve-root' not in command.script
and '--no-preserve-root' in command.stderr)
@sudo_support
def get_new_command(command, settings):
return u'{} --no-preserve-root'.format(command.script)