From 929d082b25eb385b95850e060a3b9bba166a0fa6 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Mon, 8 Feb 2021 16:03:59 +0000 Subject: [PATCH] openscad.py now quits if there are errors or warnings in the log. This is because the exit status is not always set correctly. --- scripts/openscad.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/openscad.py b/scripts/openscad.py index 5feb7bc..ccff5a5 100644 --- a/scripts/openscad.py +++ b/scripts/openscad.py @@ -33,12 +33,17 @@ def run_list(args, silent = False, verbose = False): with open("openscad.log", "w") as log: rc = subprocess.call(cmd, stdout = log, stderr = log) log_file = "openscad.echo" if "openscad.echo" in cmd else "openscad.log" + bad = False for line in open(log_file, "rt"): if verbose or 'ERROR:' in line or 'WARNING:' in line: + bad = True print(line[:-1]) if rc: sys.exit(rc) + if bad: + sys.exit(1) + def run(*args): run_list(list(args), False)