Abort requirement document creation on error

This commit is contained in:
Dirk Alders 2021-01-17 14:22:41 +01:00
parent 368b42c1ae
commit ed0d9da243
2 changed files with 4 additions and 1 deletions

View File

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

View File

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