mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-28 23:04:33 +02:00
jw.pkg.*.run_xxx(): Return exit status
Most run_xxx() return stdout and stderr. There's no way, really, for the caller to get hold of the exit code of the spawned executable. It can pass throw=true, catch, and assume a non-zero exit status. But that's not semantically clean, since the spawned function can well be a test function which is expected to return a non-zero status code, and the caller might be interested in what code that was, exactly. The clearest way to solve this is to return the exit code as well. This commit does that. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
3312b53a5b
commit
565946643b
6 changed files with 25 additions and 25 deletions
|
|
@ -35,7 +35,7 @@ class CmdGetAuthInfo(Cmd): # export
|
|||
if not os.path.isdir(jw_pkg_dir + '/.git'):
|
||||
log(DEBUG, f'jw-pkg directory is not a Git repo: {jw_pkg_dir}')
|
||||
return
|
||||
remotes, stderr = await run_cmd(['git', '-C', jw_pkg_dir, 'remote', '-v'])
|
||||
remotes, stderr, status = await run_cmd(['git', '-C', jw_pkg_dir, 'remote', '-v'])
|
||||
result: dict[str, str] = {}
|
||||
for line in remotes.splitlines():
|
||||
name, url, typ = re.split(r'\s+', line)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue