1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-21 10:08:59 +00:00
thefuck/thefuck/rules/pip_install_sudo.py
2015-04-28 15:52:09 +09:00

14 lines
401 B
Python

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)