pre-migration commit
This commit is contained in:
@@ -77,7 +77,7 @@ def _ensure_interactive_stdin() -> None:
|
||||
sys.stdin.flush()
|
||||
except Exception as e:
|
||||
if "--debug" in sys.argv:
|
||||
print(f"DEBUG: Failed to re-open stdin: {e}")
|
||||
print(f"[bootstrap] Failed to re-open stdin: {e}")
|
||||
|
||||
|
||||
def run(cmd: list[str], quiet: bool = False, debug: bool = False, cwd: Optional[Path] = None, env: Optional[dict[str, str]] = None, check: bool = True) -> subprocess.CompletedProcess:
|
||||
@@ -1799,10 +1799,10 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
raise RuntimeError("Failed to create mm.bat shim")
|
||||
|
||||
if args.debug:
|
||||
print(f"DEBUG: Created mm.bat ({len(bat_text)} bytes)")
|
||||
print(f"DEBUG: Repo path embedded in shim: {repo}")
|
||||
print(f"DEBUG: Venv location: {repo}/.venv")
|
||||
print(f"DEBUG: Shim directory: {user_bin}")
|
||||
print(f"[bootstrap] Created mm.bat ({len(bat_text)} bytes)")
|
||||
print(f"[bootstrap] Repo path embedded in shim: {repo}")
|
||||
print(f"[bootstrap] Venv location: {repo}/.venv")
|
||||
print(f"[bootstrap] Shim directory: {user_bin}")
|
||||
|
||||
# Add user_bin to PATH for current and future sessions
|
||||
str_bin = str(user_bin)
|
||||
@@ -1832,7 +1832,7 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
text=True
|
||||
)
|
||||
if args.debug and result.stderr:
|
||||
print(f"DEBUG: PowerShell output: {result.stderr}")
|
||||
print(f"[bootstrap] PowerShell output: {result.stderr}")
|
||||
|
||||
# Also reload PATH in current session for immediate availability
|
||||
reload_cmd = (
|
||||
@@ -1849,7 +1849,7 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
)
|
||||
except Exception as e:
|
||||
if args.debug:
|
||||
print(f"DEBUG: Could not persist PATH to registry: {e}", file=sys.stderr)
|
||||
print(f"[bootstrap] Could not persist PATH to registry: {e}", file=sys.stderr)
|
||||
|
||||
if not args.quiet:
|
||||
print(f"Installed global launcher to: {user_bin}")
|
||||
@@ -1927,7 +1927,7 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
'VENV="$REPO/.venv"\n'
|
||||
"# Debug mode: set MM_DEBUG=1 to print repository, venv, and import diagnostics\n"
|
||||
'if [ -n "${MM_DEBUG:-}" ]; then\n'
|
||||
' echo "MM_DEBUG: diagnostics" >&2\n'
|
||||
' echo "[mm-debug] diagnostics" >&2\n'
|
||||
' echo "Resolved REPO: $REPO" >&2\n'
|
||||
' echo "Resolved VENV: $VENV" >&2\n'
|
||||
' echo "VENV exists: $( [ -d "$VENV" ] && echo yes || echo no )" >&2\n'
|
||||
@@ -1943,7 +1943,7 @@ if (Test-Path (Join-Path $repo 'CLI.py')) {
|
||||
" $pycmd - <<'PY'\nimport sys, importlib, traceback, importlib.util\nprint('sys.executable:', sys.executable)\nprint('sys.path (first 8):', sys.path[:8])\nfor mod in ('CLI','medeia_macina','scripts.cli_entry'):\n try:\n spec = importlib.util.find_spec(mod)\n print(mod, 'spec:', spec)\n if spec:\n m = importlib.import_module(mod)\n print(mod, 'loaded at', getattr(m, '__file__', None))\n except Exception:\n print(mod, 'import failed')\n traceback.print_exc()\nPY\n"
|
||||
" fi\n"
|
||||
" done\n"
|
||||
' echo "MM_DEBUG: end diagnostics" >&2\n'
|
||||
' echo "[mm-debug] end diagnostics" >&2\n'
|
||||
"fi\n"
|
||||
"\n"
|
||||
"# Automatically check for updates if this is a git repository\n"
|
||||
|
||||
Reference in New Issue
Block a user