Skip to content

Commit 758e4d1

Browse files
fix(start_server): Projektpfad an PYTHONPATH anhängen statt vorhandenen Wert zu überschreiben — verhindert Verlust benutzerdefinierter PYTHONPATH-Einträge beim Start.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2a68e3d commit 758e4d1

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

start_server.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,19 @@ Write-Host ""
7171
# Ensure UTF-8 for Python and console to avoid encoding errors with emojis
7272
$env:PYTHONUTF8 = "1"
7373
$env:PYTHONIOENCODING = "utf-8"
74+
# (removed accidental marker)
7475
# Ensure project root is on PYTHONPATH for "src.*" imports
75-
$env:PYTHONPATH = $scriptPath
76+
# Append the project path to PYTHONPATH instead of replacing it so existing
77+
# user-defined paths remain available.
78+
if ([string]::IsNullOrEmpty($env:PYTHONPATH)) {
79+
$env:PYTHONPATH = $scriptPath
80+
} else {
81+
# Split on Windows path separator and avoid duplicating the entry
82+
$parts = $env:PYTHONPATH -split ';'
83+
if ($parts -notcontains $scriptPath) {
84+
$env:PYTHONPATH = "$scriptPath;$env:PYTHONPATH"
85+
}
86+
}
7687
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
7788

7889
python -m uvicorn webhook_server_fastapi:app --host 0.0.0.0 --port 5000 --app-dir "$scriptPath"

0 commit comments

Comments
 (0)