mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +00:00
#22 Simplify adding patterns for the sudo
rule
This commit is contained in:
parent
235b31e176
commit
b0d353c699
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
|
|
||||||
setup(name='thefuck',
|
setup(name='thefuck',
|
||||||
version=1.8,
|
version=1.9,
|
||||||
description="Magnificent app which corrects your previous console command",
|
description="Magnificent app which corrects your previous console command",
|
||||||
author='Vladimir Iakovlev',
|
author='Vladimir Iakovlev',
|
||||||
author_email='nvbn.rm@gmail.com',
|
author_email='nvbn.rm@gmail.com',
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
|
patterns = ['permission denied',
|
||||||
|
'EACCES',
|
||||||
|
'pkg: Insufficient privileges',
|
||||||
|
'you cannot perform this operation unless you are root']
|
||||||
|
|
||||||
|
|
||||||
def match(command, settings):
|
def match(command, settings):
|
||||||
return ('permission denied' in command.stderr.lower()
|
for pattern in patterns:
|
||||||
or 'EACCES' in command.stderr
|
if pattern.lower() in command.stderr.lower():
|
||||||
or 'pkg: Insufficient privileges' in command.stderr)
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def get_new_command(command, settings):
|
def get_new_command(command, settings):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user