Add transparent sudo support for rules where it required

This commit is contained in:
nvbn
2015-04-22 16:45:38 +02:00
parent 7010b3a7f6
commit e7b78205f4
11 changed files with 68 additions and 1 deletions
+3
View File
@@ -1,11 +1,14 @@
import os
from thefuck.utils import sudo_support
@sudo_support
def match(command, settings):
return os.path.exists(command.script.split()[0]) \
and 'command not found' in command.stderr
@sudo_support
def get_new_command(command, settings):
return u'./{}'.format(command.script)