mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Nicer exit code diagnostic
This commit is contained in:
13
.github/workflows/ci.py
vendored
13
.github/workflows/ci.py
vendored
@@ -20,11 +20,20 @@ SW = None
|
|||||||
def run(*a):
|
def run(*a):
|
||||||
if len(a) == 1:
|
if len(a) == 1:
|
||||||
a = shlex.split(a[0])
|
a = shlex.split(a[0])
|
||||||
print(' '.join(map(shlex.quote, a)))
|
cmd = ' '.join(map(shlex.quote, a))
|
||||||
|
print(cmd)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
ret = subprocess.Popen(a).wait()
|
ret = subprocess.Popen(a).wait()
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
raise SystemExit(ret)
|
if ret < 0:
|
||||||
|
import signal
|
||||||
|
try:
|
||||||
|
sig = signal.Signals(-ret)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise SystemExit(f'The following process was killed by signal: {sig.name}:\n{cmd}')
|
||||||
|
raise SystemExit(f'The following process failed with exit code: {ret}:\n{cmd}')
|
||||||
|
|
||||||
|
|
||||||
def install_deps():
|
def install_deps():
|
||||||
|
|||||||
Reference in New Issue
Block a user