"lib/git@developer.sourcefind.cn:OpenDAS/dynamo.git" did not exist on "675a9bf5ef964607450e0a7e1d67b8d28a468faa"
Commit 28eb8530 authored by Ziqi Fan's avatar Ziqi Fan Committed by GitHub
Browse files

refactor: update dynamo run cmd to hint user to install dynamo-run when missing (#143)

parent 3d292851
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
from __future__ import annotations from __future__ import annotations
import shutil
import subprocess import subprocess
import sys import sys
...@@ -36,8 +37,21 @@ def build_run_command() -> click.Group: ...@@ -36,8 +37,21 @@ def build_run_command() -> click.Group:
) )
def run() -> None: def run() -> None:
"""Call dynamo-run with remaining arguments""" """Call dynamo-run with remaining arguments"""
# Check if dynamo-run is available in PATH
if shutil.which("dynamo-run") is None:
click.echo(
"Error: 'dynamo-run' is needed but not found.\n"
"Please install it using: cargo install dynamo-run",
err=True,
)
sys.exit(1)
command = ["dynamo-run"] + sys.argv[2:] command = ["dynamo-run"] + sys.argv[2:]
subprocess.run(command) try:
subprocess.run(command)
except Exception as e:
click.echo(f"Error executing dynamo-run: {str(e)}", err=True)
sys.exit(1)
return cli return cli
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment