bootstrap/setup: make global 'mm' wrapper prefer venv/python3 and fall back to python; include informative error when no Python found
This commit is contained in:
@@ -363,13 +363,18 @@ python $cli @args
|
||||
sh_text = (
|
||||
"#!/usr/bin/env bash\n"
|
||||
f"REPO=\"{repo}\"\n"
|
||||
"VENV=\"$REPO/.venv\"\n"
|
||||
f"VENV=\"{repo}/.venv\"\n"
|
||||
"if [ -x \"$VENV/bin/mm\" ]; then\n"
|
||||
" exec \"$VENV/bin/mm\" \"$@\"\n"
|
||||
"elif [ -x \"$VENV/bin/python\" ]; then\n"
|
||||
" exec \"$VENV/bin/python\" -m medeia_entry \"$@\"\n"
|
||||
" exec \"$VENV/bin/python\" -m medeia_macina.cli_entry \"$@\"\n"
|
||||
"elif command -v python3 >/dev/null 2>&1; then\n"
|
||||
" exec python3 -m medeia_macina.cli_entry \"$@\"\n"
|
||||
"elif command -v python >/dev/null 2>&1; then\n"
|
||||
" exec python -m medeia_macina.cli_entry \"$@\"\n"
|
||||
"else\n"
|
||||
" exec python -m medeia_entry \"$@\"\n"
|
||||
" echo 'Error: no Python interpreter (python3 or python) found in PATH. Please install Python 3 or use the venv.' >&2\n"
|
||||
" exit 127\n"
|
||||
"fi\n"
|
||||
)
|
||||
if mm_sh.exists():
|
||||
|
||||
Reference in New Issue
Block a user