cthon: Have colors script exit with the proper exit code
Otherwise, the script will always return success and pipelines using cthon.zsh won't work properly Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
b02e2ee03d
commit
cbcc5ba269
|
@ -5,6 +5,7 @@ import termcolor
|
||||||
colors = { "b" : "blue", "g" : "green", "s" : "cyan", "l" : "yellow" }
|
colors = { "b" : "blue", "g" : "green", "s" : "cyan", "l" : "yellow" }
|
||||||
last = "white"
|
last = "white"
|
||||||
newline = False
|
newline = False
|
||||||
|
status=0
|
||||||
|
|
||||||
text = ""
|
text = ""
|
||||||
def print_text(color, attr=None):
|
def print_text(color, attr=None):
|
||||||
|
@ -20,6 +21,7 @@ while c := sys.stdin.read(1):
|
||||||
text = "\n" + text if newline else text
|
text = "\n" + text if newline else text
|
||||||
newline = False
|
newline = False
|
||||||
print_text("red", "bold")
|
print_text("red", "bold")
|
||||||
|
status=1
|
||||||
elif match := re.match("^./server -([bgsl]) .*?\n$", text):
|
elif match := re.match("^./server -([bgsl]) .*?\n$", text):
|
||||||
print_text(colors[match.group(1)], None)
|
print_text(colors[match.group(1)], None)
|
||||||
elif match := re.match("^Waiting for '([bgsl])' to finish...", text):
|
elif match := re.match("^Waiting for '([bgsl])' to finish...", text):
|
||||||
|
@ -33,3 +35,5 @@ while c := sys.stdin.read(1):
|
||||||
if len(text) > 1:
|
if len(text) > 1:
|
||||||
print_text("white", "bold")
|
print_text("white", "bold")
|
||||||
text = ""
|
text = ""
|
||||||
|
|
||||||
|
sys.exit(status)
|
||||||
|
|
Loading…
Reference in New Issue