-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.ps1
More file actions
29 lines (23 loc) · 870 Bytes
/
Copy pathstart.ps1
File metadata and controls
29 lines (23 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
$venvPython = Join-Path $PSScriptRoot "venv\Scripts\python.exe"
$venvPip = Join-Path $PSScriptRoot "venv\Scripts\pip.exe"
if (-not (Test-Path $venvPython)) {
Write-Host "venv fehlt - wird eingerichtet (einmalig)..."
python -m venv venv
& $venvPip install -r requirements.txt
Write-Host "venv bereit."
}
$port = 8060
if ($env:CURSOR_WEB_PORT) {
$port = [int]$env:CURSOR_WEB_PORT
}
$listeners = Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue
if ($listeners) {
$pids = $listeners | Select-Object -ExpandProperty OwningProcess -Unique
Write-Host "Warnung: Port $port ist bereits belegt (PID(s): $($pids -join ', '))."
Write-Host 'Alten Server beenden mit: .\stop.ps1'
Write-Host ""
}
& $venvPython serve.py