Add a support for pip install with sudo

- Fixes #136
This commit is contained in:
Namwoo Kim
2015-04-28 15:09:38 +09:00
parent 4cf631fa47
commit bc2c87e8fe
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)