diff --git a/thefuck/rules/rm_root.py b/thefuck/rules/rm_root.py new file mode 100644 index 00000000..853ce847 --- /dev/null +++ b/thefuck/rules/rm_root.py @@ -0,0 +1,8 @@ +def match(command, settings): + return ('/' in command.script.split() + and '--no-preserve-root' not in command.script + and '--no-preserve-root' in command.stderr) + + +def get_new_command(command, settings): + return '{} --no-preserve-root'.format(command.script)