Handle spaces when creating venv.
This commit is contained in:
parent
fbdc89c9b1
commit
d9b41a787c
10
webui.ps1
10
webui.ps1
|
@ -28,13 +28,15 @@ function Start-Venv {
|
||||||
if (Test-Path -Path "$VENV_DIR\Scripts\$python") {
|
if (Test-Path -Path "$VENV_DIR\Scripts\$python") {
|
||||||
Activate-Venv
|
Activate-Venv
|
||||||
} else {
|
} else {
|
||||||
|
$global:LASTEXITCODE = 0
|
||||||
|
try {
|
||||||
$PYTHON_FULLNAME = & $PYTHON -c "import sys; print(sys.executable)"
|
$PYTHON_FULLNAME = & $PYTHON -c "import sys; print(sys.executable)"
|
||||||
Write-Output "Creating venv in directory $VENV_DIR using python $PYTHON_FULLNAME"
|
Write-Output "Creating venv in directory $VENV_DIR using $PYTHON_FULLNAME"
|
||||||
Invoke-Expression "$PYTHON_FULLNAME -m venv $VENV_DIR > tmp/stdout.txt 2> tmp/stderr.txt"
|
Invoke-Expression "& '$PYTHON_FULLNAME' -m venv $VENV_DIR"
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Activate-Venv
|
Activate-Venv
|
||||||
} else {
|
} Catch {
|
||||||
Write-Output "Unable to create venv in directory $VENV_DIR"
|
Write-Output "Unable to create venv in directory $VENV_DIR"
|
||||||
|
Write-Output $_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user