Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/render_engine_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,27 @@
validate_module_site,
)

try:
# Get the RE version for display. If it's not set it means we're working locally.
from render_engine.__version__ import version as re_version
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing this because if we are working locally and installed via pip install -e I don't want this to blow up.

except ImportError:
re_version = "development"

try:
# Get the CLI version for display. If it's not set it means we're working locally.
from render_engine_cli.__version__ import version as cli_version
except ImportError:
cli_version = "development"


def get_version_string() -> str:
return f"""
Render Engine CLI version {cli_version}
Render Engine version {re_version}""".strip()


@click.group()
@click.version_option(message=get_version_string())
def app(): ...


Expand Down Expand Up @@ -297,7 +316,7 @@ def new_entry(
)
):
raise click.exceptions.BadParameter(f"Unknown collection: {collection}")
# pdb.set_trace()

filepath = Path(_collection.content_path).joinpath(filename)
if filepath.exists():
if not click.confirm(
Expand Down