openscad.py now quits if there are errors or warnings in the log.
This is because the exit status is not always set correctly.
This commit is contained in:
parent
57212b5701
commit
929d082b25
|
@ -33,12 +33,17 @@ def run_list(args, silent = False, verbose = False):
|
||||||
with open("openscad.log", "w") as log:
|
with open("openscad.log", "w") as log:
|
||||||
rc = subprocess.call(cmd, stdout = log, stderr = log)
|
rc = subprocess.call(cmd, stdout = log, stderr = log)
|
||||||
log_file = "openscad.echo" if "openscad.echo" in cmd else "openscad.log"
|
log_file = "openscad.echo" if "openscad.echo" in cmd else "openscad.log"
|
||||||
|
bad = False
|
||||||
for line in open(log_file, "rt"):
|
for line in open(log_file, "rt"):
|
||||||
if verbose or 'ERROR:' in line or 'WARNING:' in line:
|
if verbose or 'ERROR:' in line or 'WARNING:' in line:
|
||||||
|
bad = True
|
||||||
print(line[:-1])
|
print(line[:-1])
|
||||||
if rc:
|
if rc:
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
|
|
||||||
|
if bad:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def run(*args):
|
def run(*args):
|
||||||
run_list(list(args), False)
|
run_list(list(args), False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue