ifcopenshell.validate return code 1 in case of some file is invalid

This commit is contained in:
Andrej730
2024-09-02 14:31:33 +05:00
parent 5f5ab10b35
commit e50a90cc9f
@@ -600,6 +600,7 @@ if __name__ == "__main__":
filenames = [x for x in sys.argv[1:] if not x.startswith("--")]
flags = set(x for x in sys.argv[1:] if x.startswith("--"))
some_file_is_invalid = False
for fn in filenames:
handler = None
@@ -636,5 +637,10 @@ if __name__ == "__main__":
else: # json_logger.
invalid_ifc = bool(logger.statements)
if not invalid_ifc:
if invalid_ifc:
some_file_is_invalid = True
else:
print("No validation issues found.")
if some_file_is_invalid:
exit(1)