#132 Merge pip_install_sudo rule with sudo rule
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
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)
|
||||
@@ -13,7 +13,8 @@ patterns = ['permission denied',
|
||||
|
||||
def match(command, settings):
|
||||
for pattern in patterns:
|
||||
if pattern.lower() in command.stderr.lower():
|
||||
if pattern.lower() in command.stderr.lower()\
|
||||
or pattern.lower() in command.stdout.lower():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user