d
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user