mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-27 09:10:02 -05:00
make_all.py now terminates early if there are any errors in bom generation.
This commit is contained in:
parent
cedaafed3d
commit
828e5ad36e
@ -213,7 +213,7 @@ def parse_bom(file = "openscad.log", name = None):
|
||||
main.assemblies[stack[-1]].add_part(s)
|
||||
else:
|
||||
if 'ERROR:' in line or 'WARNING:' in line:
|
||||
print(line[:-1])
|
||||
raise Exception(line[:-1])
|
||||
return main
|
||||
|
||||
def usage():
|
||||
@ -221,6 +221,7 @@ def usage():
|
||||
sys.exit(1)
|
||||
|
||||
def boms(target = None, assembly = None):
|
||||
try:
|
||||
bom_dir = set_config(target, usage) + "bom"
|
||||
if assembly:
|
||||
bom_dir += "/accessories"
|
||||
@ -268,6 +269,9 @@ def boms(target = None, assembly = None):
|
||||
json.dump(data, outfile, indent = 4)
|
||||
|
||||
print("done")
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) > 3: usage()
|
||||
@ -286,8 +290,4 @@ if __name__ == '__main__':
|
||||
if assembly:
|
||||
if assembly[-9:] != "_assembly": usage()
|
||||
|
||||
try:
|
||||
boms(target, assembly)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user