Fix sintaxa PowerShell in setup_dev.ps1

- Înlocuit goto (batch) cu flag $skipCreate
- Structura if corectă pentru PowerShell

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-06 21:02:37 +02:00
parent ad5e86ccca
commit 6736f6f884

View File

@@ -38,6 +38,8 @@ try {
# Verifică dacă venv există deja
$venvPath = Join-Path $ProjectDir ".venv"
$skipCreate = $false
if (Test-Path (Join-Path $venvPath "Scripts\Activate.ps1")) {
Write-Host "[INFO] Virtual environment exista deja." -ForegroundColor Yellow
$recreate = Read-Host "Doresti sa il stergi si sa recreezi? (y/N)"
@@ -45,26 +47,26 @@ if (Test-Path (Join-Path $venvPath "Scripts\Activate.ps1")) {
Write-Host "Stergere venv existent..." -ForegroundColor Yellow
Remove-Item -Path $venvPath -Recurse -Force
} else {
# Skip la activare
goto ActivateVenv
$skipCreate = $true
}
}
# Creează virtual environment
Write-Host "[STEP 1/5] Creare virtual environment..." -ForegroundColor Cyan
try {
& python -m venv .venv
Write-Host "[OK] Virtual environment creat." -ForegroundColor Green
Write-Host ""
} catch {
Write-Host "[ERROR] Nu am putut crea venv!" -ForegroundColor Red
Write-Host "Eroare: $_" -ForegroundColor Red
Write-Host ""
Read-Host "Apasa Enter pentru a inchide"
exit 1
if (-not $skipCreate) {
Write-Host "[STEP 1/5] Creare virtual environment..." -ForegroundColor Cyan
try {
& python -m venv .venv
Write-Host "[OK] Virtual environment creat." -ForegroundColor Green
Write-Host ""
} catch {
Write-Host "[ERROR] Nu am putut crea venv!" -ForegroundColor Red
Write-Host "Eroare: $_" -ForegroundColor Red
Write-Host ""
Read-Host "Apasa Enter pentru a inchide"
exit 1
}
}
:ActivateVenv
# Activează venv
Write-Host "[STEP 2/5] Activare virtual environment..." -ForegroundColor Cyan
$activateScript = Join-Path $venvPath "Scripts\Activate.ps1"