From 22f656b800c66cd189e8f039b680b92bb3464122 Mon Sep 17 00:00:00 2001 From: Steve Nixon Date: Mon, 11 Apr 2022 22:47:50 -0700 Subject: [PATCH] Adding check for valid output path --- video2x/video2x.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video2x/video2x.py b/video2x/video2x.py index 3c165fd..379ea12 100755 --- a/video2x/video2x.py +++ b/video2x/video2x.py @@ -586,6 +586,11 @@ def main() -> int: if not args.input.is_file(): logger.critical("Input path is not a file") return 1 + + # Output file won't exist yet, but the parent directory should. + if not args.output.parent.exists(): + logger.critical(f"Output directory does not exist: {args.output}") + return 1 # set logger level if os.environ.get("LOGURU_LEVEL") is None: