A bit more intelligent behavior for the execute
This commit is contained in:
parent
75eb686f09
commit
a26a578396
|
@ -83,10 +83,11 @@ class Execute(CommandContainer):
|
||||||
@classmethod
|
@classmethod
|
||||||
def terminated(cls, processor, popen):
|
def terminated(cls, processor, popen):
|
||||||
stdout, stderr = cls.fetch(popen)
|
stdout, stderr = cls.fetch(popen)
|
||||||
if stdout:
|
success = popen.returncode == 0
|
||||||
|
if success and stdout:
|
||||||
processor.echo(stdout)
|
processor.echo(stdout)
|
||||||
elif stderr:
|
elif not success and stderr:
|
||||||
processor.echo(stderr)
|
processor.echo_error(stderr)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def overdue(cls, processor, popen):
|
def overdue(cls, processor, popen):
|
||||||
|
@ -112,7 +113,8 @@ class Show(Execute):
|
||||||
@classmethod
|
@classmethod
|
||||||
def terminated(cls, processor, popen):
|
def terminated(cls, processor, popen):
|
||||||
stdout, stderr = cls.fetch(popen)
|
stdout, stderr = cls.fetch(popen)
|
||||||
if stdout:
|
success = popen.returncode == 0
|
||||||
|
if success and stdout:
|
||||||
processor.send(stdout)
|
processor.send(stdout)
|
||||||
elif stderr:
|
elif not success and stderr:
|
||||||
processor.send(stderr)
|
processor.echo_error(stderr)
|
Loading…
Reference in New Issue