#When doing ziglings, how to stop screen on first failed test?
1 messages · Page 1 of 1 (latest)
ChatGPT helped 😄
#!/usr/bin/env python3
import re
import sys
import os
def clear_terminal():
if os.name == "posix": # Linux and macOS
os.system("clear")
elif os.name == "nt": # Windows
os.system("cls")
pattern = r'(Compiling .*\nerror: .*)'
input_text = sys.stdin.read()
clear_terminal()
matches = re.findall(pattern, input_text)
for match in matches:
print(match)
remaining_lines = input_text.split(match, 1)[1]
print(remaining_lines)
watchexec -i zig-cache -e zig -r 'zig build 2>&1 | ziglings_cut_passed.py'
EW NO
def clear_terminal():
if os.name == "posix": # Linux and macOS
sys.stdout.write("\x1b[2J\x1b[H")
elif os.name == "nt": # Windows
os.system("cls")