⚠️ Remove settings param from rules match, get_new_command and side_effect
This commit is contained in:
@@ -6,7 +6,7 @@ from ..utils import quote, is_app
|
||||
|
||||
|
||||
@decorator
|
||||
def git_support(fn, command, settings):
|
||||
def git_support(fn, command):
|
||||
"""Resolves git aliases and supports testing for both git and hub."""
|
||||
# supports GitHub's `hub` command
|
||||
# which is recommended to be used with `alias git=hub`
|
||||
@@ -29,4 +29,4 @@ def git_support(fn, command, settings):
|
||||
|
||||
command = Command._replace(command, script=new_script)
|
||||
|
||||
return fn(command, settings)
|
||||
return fn(command)
|
||||
|
||||
@@ -4,15 +4,14 @@ from ..types import Command
|
||||
|
||||
|
||||
@decorator
|
||||
def sudo_support(fn, command, settings):
|
||||
def sudo_support(fn, command):
|
||||
"""Removes sudo before calling fn and adds it after."""
|
||||
if not command.script.startswith('sudo '):
|
||||
return fn(command, settings)
|
||||
return fn(command)
|
||||
|
||||
result = fn(Command(command.script[5:],
|
||||
command.stdout,
|
||||
command.stderr),
|
||||
settings)
|
||||
command.stderr))
|
||||
|
||||
if result and isinstance(result, six.string_types):
|
||||
return u'sudo {}'.format(result)
|
||||
|
||||
Reference in New Issue
Block a user