Add segmented fallback for unmatched beats

This commit is contained in:
Melbar
2026-05-02 11:46:33 +02:00
parent 535176c144
commit f1173eacee
3 changed files with 201 additions and 1 deletions
+19 -1
View File
@@ -44,7 +44,25 @@ if ($pythonVersion -notmatch "3\.(1[1-9]|[2-9]\d)") {
# ---- 2. Create venv ---------------------------------------------------------
if (Test-Path $VENV_DIR) {
Write-Host "Virtual environment already exists at '$VENV_DIR'. Skipping creation." -ForegroundColor Yellow
$existingVenvPython = Join-Path $VENV_DIR "Scripts\python.exe"
$venvOk = $false
if (Test-Path $existingVenvPython) {
try {
$existingVersion = & $existingVenvPython --version 2>&1
$venvOk = $LASTEXITCODE -eq 0 -and $existingVersion -match "3\.(1[1-9]|[2-9]\d)"
} catch {
$venvOk = $false
}
}
if ($venvOk) {
Write-Host "Virtual environment already exists at '$VENV_DIR'. Skipping creation." -ForegroundColor Yellow
} else {
Write-Host "Existing virtual environment is not usable. Recreating '$VENV_DIR' ..." -ForegroundColor Yellow
Remove-Item -LiteralPath $VENV_DIR -Recurse -Force
& $PROJECT_PYTHON -m venv $VENV_DIR
Write-Host "Done." -ForegroundColor Green
}
} else {
Write-Host "Creating virtual environment in '$VENV_DIR' ..." -ForegroundColor Green
& $PROJECT_PYTHON -m venv $VENV_DIR