mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 05:00:53 +00:00
ifcopenshell.validate return code 1 in case of some file is invalid
This commit is contained in:
@@ -600,6 +600,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
filenames = [x for x in sys.argv[1:] if not x.startswith("--")]
|
filenames = [x for x in sys.argv[1:] if not x.startswith("--")]
|
||||||
flags = set(x for x in sys.argv[1:] if x.startswith("--"))
|
flags = set(x for x in sys.argv[1:] if x.startswith("--"))
|
||||||
|
some_file_is_invalid = False
|
||||||
|
|
||||||
for fn in filenames:
|
for fn in filenames:
|
||||||
handler = None
|
handler = None
|
||||||
@@ -636,5 +637,10 @@ if __name__ == "__main__":
|
|||||||
else: # json_logger.
|
else: # json_logger.
|
||||||
invalid_ifc = bool(logger.statements)
|
invalid_ifc = bool(logger.statements)
|
||||||
|
|
||||||
if not invalid_ifc:
|
if invalid_ifc:
|
||||||
|
some_file_is_invalid = True
|
||||||
|
else:
|
||||||
print("No validation issues found.")
|
print("No validation issues found.")
|
||||||
|
|
||||||
|
if some_file_is_invalid:
|
||||||
|
exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user