mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-05 06:57:27 +02:00
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:
@@ -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)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user