mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-14 06:38:32 +00:00
implement self protecting thefuck so when people attempt to incorrectly uninstall it, it questions whether or not they really want to in a funny away
This commit is contained in:
parent
9817e6a974
commit
85f32e2862
11
thefuck/rules/uninstall_thefuck.py
Normal file
11
thefuck/rules/uninstall_thefuck.py
Normal file
@ -0,0 +1,11 @@
|
||||
def match(command):
|
||||
return('uninstall' in command.script and 'thefuck' in command.script)
|
||||
|
||||
def get_new_command(command):
|
||||
new_commands = []
|
||||
new_commands.append('What thefuck are you doing? Are you sure you want to uninstall? [Arrow down to uninstall]')
|
||||
|
||||
if('command not found' not in command.output):
|
||||
new_commands.append(command.script)
|
||||
|
||||
return new_commands
|
Loading…
x
Reference in New Issue
Block a user