-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFixPipe.ps1
More file actions
47 lines (43 loc) · 1.36 KB
/
Copy pathFixPipe.ps1
File metadata and controls
47 lines (43 loc) · 1.36 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Start-Transcript .\lastlogexecution-FixPipe.log
try {
# Check if uv is available
$uvAvailable = $false
try {
$uvVersion = uv --version 2>$null
if ($LASTEXITCODE -eq 0) {
$uvAvailable = $true
Write-Host "Using uv (version: $uvVersion)" -ForegroundColor Green
}
}
catch {
# uv not found, will fall back to traditional venv
}
# Activate environment
if ($uvAvailable) {
# Use uv to run the script directly
Write-Host "Running FixPipe.py with uv..." -ForegroundColor Yellow
uv run FixPipe.py
}
else {
# Fall back to traditional virtual environment activation
Write-Host "Using traditional virtual environment..." -ForegroundColor Yellow
if (Test-Path ".\Scripts\Activate.ps1") {
.\Scripts\Activate.ps1
}
elseif (Test-Path ".\.venv\Scripts\Activate.ps1") {
.\.venv\Scripts\Activate.ps1
}
else {
Write-Host "Warning: No virtual environment activation script found. Running with system Python." -ForegroundColor Yellow
}
Write-Host "Running FixPipe.py..." -ForegroundColor Yellow
python FixPipe.py
}
}
catch {
Write-Host "Error occurred:" -ForegroundColor Red
Write-Host $Error[0].Exception -ForegroundColor Red
}
finally {
Stop-Transcript
}