mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
jw.pkg.lib.App.__run(): Use return value as exit status
If a Cmd-classes's _run() method returns an integer between 0 and 255, use that as the program's exit status. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
565946643b
commit
7fcb031795
1 changed files with 3 additions and 0 deletions
|
|
@ -116,6 +116,9 @@ class App: # export
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ret = await self._run(self.__args)
|
ret = await self._run(self.__args)
|
||||||
|
if isinstance(ret, int) and ret >= 0 and ret <= 0xFF:
|
||||||
|
exit_status = ret
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log(ERR, repr(e) if self.__back_trace else str(e))
|
log(ERR, repr(e) if self.__back_trace else str(e))
|
||||||
exit_status = 1
|
exit_status = 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue