Adding check for valid output path

This commit is contained in:
Steve Nixon 2022-04-11 22:47:50 -07:00
parent 8eeba71ece
commit 22f656b800

View File

@ -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: