Skip to content
Snippets Groups Projects
Commit a26a5783 authored by Alexander Cherniuk's avatar Alexander Cherniuk
Browse files

A bit more intelligent behavior for the execute

parent 75eb686f
No related branches found
No related tags found
No related merge requests found
......@@ -83,10 +83,11 @@ class Execute(CommandContainer):
@classmethod
def terminated(cls, processor, popen):
stdout, stderr = cls.fetch(popen)
if stdout:
success = popen.returncode == 0
if success and stdout:
processor.echo(stdout)
elif stderr:
processor.echo(stderr)
elif not success and stderr:
processor.echo_error(stderr)
@classmethod
def overdue(cls, processor, popen):
......@@ -112,7 +113,8 @@ class Show(Execute):
@classmethod
def terminated(cls, processor, popen):
stdout, stderr = cls.fetch(popen)
if stdout:
success = popen.returncode == 0
if success and stdout:
processor.send(stdout)
elif stderr:
processor.send(stderr)
\ No newline at end of file
elif not success and stderr:
processor.echo_error(stderr)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment