From 1421a1eec94111e6015cfbaead69c00451eee2c4 Mon Sep 17 00:00:00 2001 From: mlnl Date: Tue, 27 Aug 2024 15:19:42 -0700 Subject: [PATCH] adding output path check --- vcsi/vcsi.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vcsi/vcsi.py b/vcsi/vcsi.py index cf9d934..33aa9ac 100755 --- a/vcsi/vcsi.py +++ b/vcsi/vcsi.py @@ -1616,6 +1616,9 @@ def main(): print_template_attributes() sys.exit(0) + if len(args.thumbnail_output_path) != 0: + check_output_path_exists(args.thumbnail_output_path) + def process_file_or_ignore(filepath, args): try: process_file(filepath, args) @@ -1800,5 +1803,9 @@ def process_file(path, args): error_exit("Unsupported image format: %s." % (args.image_format,)) +def check_output_path_exists(thumbnail_output_path: str): + os.makedirs(thumbnail_output_path, exist_ok=True) + return + if __name__ == "__main__": main()