@@ -389,28 +389,29 @@ class EcoCodeController implements vscode.WebviewViewProvider {
389389 const globalInstallRoot = getGlobalInstallRoot ( ) ;
390390 const venvPath = path . join ( globalInstallRoot , "venv" ) ;
391391 const installSource = loadSettings ( ) . installSource ;
392+ const gitFallback = "git+https://github.com/LeonardLeroy/EcoCode.git" ;
392393
393394 // Strategy (both OSes): use pipx when available (isolated, on PATH, PEP 668-safe);
394395 // otherwise create a dedicated venv. `-U` / `--force` make re-running upgrade the CLI.
395396 const setupCommand = isWindows
396397 ? [
397398 `if (Get-Command pipx -ErrorAction SilentlyContinue) {` ,
398- ` pipx install --force "${ installSource } "` ,
399+ ` pipx install --force "${ installSource } "; if ($LASTEXITCODE -ne 0) { pipx install --force " ${ gitFallback } " } ` ,
399400 `} else {` ,
400401 ` New-Item -ItemType Directory -Force -Path "${ globalInstallRoot } " | Out-Null;` ,
401402 ` if (Get-Command py -ErrorAction SilentlyContinue) { py -3 -m venv "${ venvPath } " } else { python -m venv "${ venvPath } " };` ,
402403 ` & "${ globalPythonPath } " -m pip install --upgrade pip;` ,
403- ` & "${ globalPythonPath } " -m pip install -U "${ installSource } "` ,
404+ ` & "${ globalPythonPath } " -m pip install -U "${ installSource } "; if ($LASTEXITCODE -ne 0) { & " ${ globalPythonPath } " -m pip install -U " ${ gitFallback } " } ` ,
404405 `}` ,
405406 ] . join ( " " )
406407 : [
407408 `if command -v pipx >/dev/null 2>&1; then` ,
408- ` pipx install --force "${ installSource } ";` ,
409+ ` pipx install --force "${ installSource } " || pipx install --force " ${ gitFallback } " ;` ,
409410 `else` ,
410411 ` mkdir -p "${ globalInstallRoot } ";` ,
411412 ` python3 -m venv "${ venvPath } " || python -m venv "${ venvPath } ";` ,
412413 ` "${ globalPythonPath } " -m pip install --upgrade pip;` ,
413- ` "${ globalPythonPath } " -m pip install -U "${ installSource } ";` ,
414+ ` "${ globalPythonPath } " -m pip install -U "${ installSource } " || " ${ globalPythonPath } " -m pip install -U " ${ gitFallback } " ;` ,
414415 `fi` ,
415416 ] . join ( " " ) ;
416417
0 commit comments