From be93d73938c940abf76ad177a7006de935eb8263 Mon Sep 17 00:00:00 2001 From: Nose Date: Fri, 9 Jan 2026 17:19:32 -0800 Subject: [PATCH] d --- docs/BOOTSTRAP_TROUBLESHOOTING.md | 2 +- scripts/bootstrap.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/BOOTSTRAP_TROUBLESHOOTING.md b/docs/BOOTSTRAP_TROUBLESHOOTING.md index ecdac77..7a45c52 100644 --- a/docs/BOOTSTRAP_TROUBLESHOOTING.md +++ b/docs/BOOTSTRAP_TROUBLESHOOTING.md @@ -1,4 +1,4 @@ -# Bootstrap Installation Troubleshooting Guide + # Bootstrap Installation Troubleshooting Guide ## Problem on "Other Computer" diff --git a/scripts/bootstrap.py b/scripts/bootstrap.py index 272c365..313e3fb 100644 --- a/scripts/bootstrap.py +++ b/scripts/bootstrap.py @@ -1001,17 +1001,18 @@ if (Test-Path (Join-Path $repo 'CLI.py')) { f'set "REPO={repo_bat_str}"\n' "set \"VENV=!REPO!\\.venv\"\n" "set \"PY=!VENV!\\Scripts\\python.exe\"\n" + "set \"ENTRY=!REPO!\\scripts\\cli_entry.py\"\n" "if exist \"!PY!\" (\n" " if defined MM_DEBUG (\n" " echo MM_DEBUG: using venv python at !PY!\n" " \"!PY!\" -c \"import sys; print('sys.executable:', sys.executable); print('sys.path:', sys.path[:5])\"\n" " )\n" - " \"!PY!\" -m scripts.cli_entry %*\n" + " \"!PY!\" \"!ENTRY!\" %*\n" " exit /b !ERRORLEVEL!\n" ")\n" "echo MM: venv python not found at !PY!\n" "if defined MM_DEBUG echo MM_DEBUG: venv python not found, trying system python\n" - "python -m scripts.cli_entry %*\n" + "python \"!ENTRY!\" %*\n" "exit /b !ERRORLEVEL!\n" ) if mm_bat.exists(): @@ -1044,7 +1045,8 @@ if (Test-Path (Join-Path $repo 'CLI.py')) { "$bin = '{bin}';" "$cur = [Environment]::GetEnvironmentVariable('PATH','User');" "if ($cur -notlike \"*$bin*\") {{" - "[Environment]::SetEnvironmentVariable('PATH', ($bin + ';' + ($cur -ne $null ? $cur : '')), 'User');" + " $val = if ($cur) {{ $bin + ';' + $cur }} else {{ $bin }};" + " [Environment]::SetEnvironmentVariable('PATH', $val, 'User');" "}}" ).format(bin=str_bin.replace("\\", "\\\\")) result = subprocess.run(