1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-29 14:08:44 +00:00
2015-04-21 12:57:35 +04:30

19 lines
517 B
Python

patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege']
def match(command, settings):
for pattern in patterns:
if pattern.lower() in command.stderr.lower():
return True
return False
def get_new_command(command, settings):
return u'sudo {}'.format(command.script)