Added a rule to delete sudo for pacaur. (#787)
This commit is contained in:
committed by
Vladimir Iakovlev
parent
b65e3a9aad
commit
dd9554539f
@@ -0,0 +1,15 @@
|
||||
patterns = ['you cannot perform this operation as root']
|
||||
|
||||
|
||||
def match(command):
|
||||
if command.script_parts and command.script_parts[0] != 'sudo':
|
||||
return False
|
||||
|
||||
for pattern in patterns:
|
||||
if pattern in command.output.lower():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def get_new_command(command):
|
||||
return ' '.join(command.script_parts[1:])
|
||||
Reference in New Issue
Block a user