Merge branch 'pip-needs-sudo' of https://github.com/kimtree/thefuck into kimtree-pip-needs-sudo

This commit is contained in:
nvbn
2015-04-29 04:52:09 +02:00
2 changed files with 71 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import re
from thefuck.utils import sudo_support
def match(command, settings):
return (('pip' in command.script and 'install' in command.script) and
'failed with error code 1' in command.stderr and
('Errno 13' in command.stdout or
'Permission denied' in command.stdout))
def get_new_command(command, settings):
return u'sudo {}'.format(command.script)