diff --git a/zndraw/cli.py b/zndraw/cli.py index c332197c..07d9bef6 100644 --- a/zndraw/cli.py +++ b/zndraw/cli.py @@ -5,6 +5,7 @@ import dataclasses import datetime import os +import pathlib import typing as t import typer @@ -166,6 +167,11 @@ def main( env_config.save_to_env() + if remote is None and rev is None: + if not pathlib.Path(filename).exists(): + typer.echo(f"File {filename} does not exist.") + raise typer.Exit(code=1) + if standalone and url is None: if env_config.FLASK_STORAGE.startswith("znsocket"): # standalone with redis would assume a running instance of redis