Move commands-related logic to Command and CorrectedCommand
This commit is contained in:
@@ -27,6 +27,6 @@ def git_support(fn, command):
|
||||
expansion = ' '.join(map(quote, split(search.group(2))))
|
||||
new_script = command.script.replace(alias, expansion)
|
||||
|
||||
command = Command._replace(command, script=new_script)
|
||||
command = command.update(script=new_script)
|
||||
|
||||
return fn(command)
|
||||
|
||||
@@ -9,9 +9,7 @@ def sudo_support(fn, command):
|
||||
if not command.script.startswith('sudo '):
|
||||
return fn(command)
|
||||
|
||||
result = fn(Command(command.script[5:],
|
||||
command.stdout,
|
||||
command.stderr))
|
||||
result = fn(command.update(script=command.script[5:]))
|
||||
|
||||
if result and isinstance(result, six.string_types):
|
||||
return u'sudo {}'.format(result)
|
||||
|
||||
Reference in New Issue
Block a user