From ed0d9da2435d75a79ff6298dbf324dd7e3181016 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 17 Jan 2021 14:22:41 +0100 Subject: [PATCH] Abort requirement document creation on error --- __init__.py | 3 ++- reqif_conv.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 39bf46a..6837b08 100644 --- a/__init__.py +++ b/__init__.py @@ -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)) diff --git a/reqif_conv.py b/reqif_conv.py index 7e4ab44..c7c19c7 100644 --- a/reqif_conv.py +++ b/reqif_conv.py @@ -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