Work on render templates.py added argument for variable file

This commit is contained in:
Chris Diesch 2025-03-28 13:39:34 -06:00
parent 247b5adb1f
commit 12b7673b6e
2 changed files with 14 additions and 1 deletions

View File

@ -2,3 +2,4 @@ flask==3.1.0
flask-restx==1.3.0
pyopenssl==25.0.0
werkzeug==3.1.3
jinja2==3.1.6

View File

@ -21,6 +21,8 @@ if __name__ == '__main__':
add_help=True)
parser.add_argument('template_path',
help='The path to the template to render.')
parser.add_argument('var_file_path',
help='The path to the file containing the variables to use for rendering the tempalte(s).')
parser.add_argument('out_path',
help='The path to write the rendered template.')
parser.add_argument('-k',
@ -34,3 +36,13 @@ if __name__ == '__main__':
action='store_true',
help='If set the previous template will be overwritten.')
args = parser.parse_args()
if not os.path.exists(args.template_path):
print(f'The given template path {args.template_path} does not exist.')
exit(1)
if not os.path.exists(args.var_file_path):
print(f'The given template path {args.var_file_path} does not exist.')
exit(1)