INNER CODE UNIT · Python

_run_script

pegasus-isi/pegasus · packages/pegasus-python/src/Pegasus/cli/main.py:25

def _run_script(script_name: str, args, *, search_worker: bool = False) -> None:
    """Run a hyphenated CLI script as __main__ via runpy."""
    path = _CLI_DIR / f"{script_name}.py"
    if not path.exists():
        click.echo(f"pegasus: {script_name}: script not found at {path}", err=True)
        sys.exit(1)
    sys.argv = [script_name] + list(args)
    runpy.run_path(str(path), run_name="__main__")


def _run_java(main_class: str, args) -> None:
    from Pegasus.cli._java import get_system_properties, run_java_tool

    run_java_tool(main_class, args=args, system_properties=get_system_properties())


def _exec_binary(binary_name: str, args) -> None:
    """Exec a compiled (non-Python) CLI tool installed alongside this

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…