Skip to content

Commit 9f7ebbb

Browse files
Copilotpamelafox
andcommitted
Fix start.ps1 to use correct venv paths matching start.sh
Co-authored-by: pamelafox <297042+pamelafox@users.noreply.github.com>
1 parent a22e6a0 commit 9f7ebbb

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

app/start.ps1

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
Write-Host 'Creating python virtual environment "backend/backend_env"'
1+
Set-Location ../
2+
3+
Write-Host 'Creating python virtual environment ".venv"'
24
$pythonCmd = Get-Command python -ErrorAction SilentlyContinue
35
if (-not $pythonCmd) {
46
# fallback to python3 if python not found
57
$pythonCmd = Get-Command python3 -ErrorAction SilentlyContinue
68
}
7-
Start-Process -FilePath ($pythonCmd).Source -ArgumentList "-m venv ./backend/backend_env" -Wait -NoNewWindow
9+
Start-Process -FilePath ($pythonCmd).Source -ArgumentList "-m venv .venv" -Wait -NoNewWindow
810

911
Write-Host ""
1012
Write-Host "Restoring backend python packages"
1113
Write-Host ""
1214

13-
$venvPythonPath = "./venv/scripts/python.exe"
15+
$venvPythonPath = "./.venv/Scripts/python.exe"
1416
if (Test-Path -Path "/usr") {
1517
# fallback to Linux venv path
16-
$venvPythonPath = "./venv/bin/python"
18+
$venvPythonPath = "./.venv/bin/python"
1719
}
1820

1921
Start-Process -FilePath $venvPythonPath -ArgumentList "-m pip install -r app/backend/requirements.txt" -Wait -NoNewWindow
@@ -25,7 +27,7 @@ if ($LASTEXITCODE -ne 0) {
2527
Write-Host ""
2628
Write-Host "Restoring frontend npm packages"
2729
Write-Host ""
28-
Set-Location ../frontend
30+
Set-Location app/frontend
2931
npm install
3032
if ($LASTEXITCODE -ne 0) {
3133
Write-Host "Failed to restore frontend npm packages"
@@ -46,6 +48,13 @@ Write-Host "Starting backend"
4648
Write-Host ""
4749
Set-Location ../backend
4850

51+
# Update venv path for backend directory
52+
$venvPythonPath = "../../.venv/Scripts/python.exe"
53+
if (Test-Path -Path "/usr") {
54+
# fallback to Linux venv path
55+
$venvPythonPath = "../../.venv/bin/python"
56+
}
57+
4958
$port = 50505
5059
$hostname = "localhost"
5160
Start-Process -FilePath $venvPythonPath -ArgumentList "-m quart --app main:app run --port $port --host $hostname --reload" -Wait -NoNewWindow

0 commit comments

Comments
 (0)