mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-22 12:58:33 +00:00
Merge pull request #461 from mcarton/ruby-gem
Add ruby gem error message to sudo patterns
This commit is contained in:
commit
60497b9d04
@ -1,12 +1,12 @@
|
|||||||
patterns = ['permission denied',
|
patterns = ['permission denied',
|
||||||
'EACCES',
|
'eacces',
|
||||||
'pkg: Insufficient privileges',
|
'pkg: insufficient privileges',
|
||||||
'you cannot perform this operation unless you are root',
|
'you cannot perform this operation unless you are root',
|
||||||
'non-root users cannot',
|
'non-root users cannot',
|
||||||
'Operation not permitted',
|
'operation not permitted',
|
||||||
'root privilege',
|
'root privilege',
|
||||||
'This command has to be run under the root user.',
|
'this command has to be run under the root user.',
|
||||||
'This operation requires root.',
|
'this operation requires root.',
|
||||||
'requested operation requires superuser privilege',
|
'requested operation requires superuser privilege',
|
||||||
'must be run as root',
|
'must be run as root',
|
||||||
'must run as root',
|
'must run as root',
|
||||||
@ -16,9 +16,10 @@ patterns = ['permission denied',
|
|||||||
'need root',
|
'need root',
|
||||||
'needs to be run as root',
|
'needs to be run as root',
|
||||||
'only root can ',
|
'only root can ',
|
||||||
'You don\'t have access to the history DB.',
|
'you don\'t have access to the history db.',
|
||||||
'authentication is required',
|
'authentication is required',
|
||||||
'eDSPermissionError']
|
'edspermissionerror',
|
||||||
|
'you don\'t have write permissions']
|
||||||
|
|
||||||
|
|
||||||
def match(command):
|
def match(command):
|
||||||
@ -26,8 +27,8 @@ def match(command):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
for pattern in patterns:
|
for pattern in patterns:
|
||||||
if pattern.lower() in command.stderr.lower()\
|
if pattern in command.stderr.lower()\
|
||||||
or pattern.lower() in command.stdout.lower():
|
or pattern in command.stdout.lower():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user