Abort requirement document creation on error

This commit is contained in:
Dirk Alders 2021-01-17 14:22:41 +01:00
джерело 368b42c1ae
коміт ed0d9da243
2 змінених файлів з 4 додано та 1 видалено

@ -1,5 +1,6 @@
import optparse import optparse
import os import os
import sys
import xml_parser import xml_parser
import reqif_conv import reqif_conv
@ -83,4 +84,4 @@ if __name__ == '__main__':
tex_path = os.path.abspath(os.path.splitext(reqif_path)[0] + '.tex') tex_path = os.path.abspath(os.path.splitext(reqif_path)[0] + '.tex')
reqif_data = reqif_dict(reqif_path, 'Heading', 'Software Specification') reqif_data = reqif_dict(reqif_path, 'Heading', 'Software Specification')
reqif_conv.tex_gen(reqif_data, tex_path) reqif_conv.tex_gen(reqif_data, tex_path)
reqif_conv.pdf_gen(tex_path) sys.exit(reqif_conv.pdf_gen(tex_path))

@ -30,6 +30,8 @@ def pdf_gen(tex_path):
exit_value = os.system("pdflatex -interaction nonstopmode %s 1> /dev/null" % tex_path) exit_value = os.system("pdflatex -interaction nonstopmode %s 1> /dev/null" % tex_path)
if exit_value != 0: if exit_value != 0:
print('FAILED') print('FAILED')
return -1
break break
else: else:
print('SUCCESS') print('SUCCESS')
return 0