Skip to content

Commit

Permalink
Adding check for valid output path
Browse files Browse the repository at this point in the history
  • Loading branch information
snixon committed Apr 12, 2022
1 parent 8eeba71 commit 22f656b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions video2x/video2x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 22f656b

Please sign in to comment.