This commit is contained in:
Your Name
2026-10-08 15:49:53 +08:00
parent 1c9b093e08
commit 67c374d899
52 changed files with 51959 additions and 75 deletions
+12 -8
View File
@@ -9,6 +9,7 @@ $FrozenExecutable = Join-Path $ProjectRoot "dist\DoctorWorkstation\DoctorWorksta
$ProjectPython = Join-Path $ProjectRoot ".venv\Scripts\python.exe"
$ProjectUvCache = Join-Path $ProjectRoot ".uv-cache"
$SourceRoot = Join-Path $ProjectRoot "src"
$SourceEntry = Join-Path $SourceRoot "doctor_workstation\__main__.py"
function Test-ProjectPython {
param([Parameter(Mandatory = $true)][string]$Candidate)
@@ -33,7 +34,13 @@ function Find-Uv {
}
try {
if (Test-Path -LiteralPath $FrozenExecutable -PathType Leaf) {
$Python = $null
if ((Test-Path -LiteralPath $SourceEntry -PathType Leaf) -and
(Test-ProjectPython -Candidate $ProjectPython)) {
$Python = $ProjectPython
Write-Host "Using current source tree: $SourceRoot"
}
elseif (Test-Path -LiteralPath $FrozenExecutable -PathType Leaf) {
Write-Host "Using packaged application: $FrozenExecutable"
if ($ValidateOnly) {
Write-Host "Windows run entry validation passed."
@@ -47,13 +54,7 @@ try {
}
exit $ApplicationExitCode
}
$Python = $null
if (Test-ProjectPython -Candidate $ProjectPython) {
$Python = $ProjectPython
Write-Host "Using existing project environment: $ProjectPython"
}
else {
elseif (Test-Path -LiteralPath $SourceEntry -PathType Leaf) {
$Uv = Find-Uv
if (-not $Uv) {
throw "No packaged application or usable .venv was found, and uv is not installed."
@@ -108,6 +109,9 @@ try {
}
$Python = $ProjectPython
}
else {
throw "No source entry or packaged application was found."
}
if ($ValidateOnly) {
Write-Host "Windows run entry validation passed."