fix(ci): fix PowerShell parse error in Add Rust to PATH step
Em dash in Write-Error string broke PowerShell string termination. Also try C:\Users\%USERNAME%\.cargo\bin as fallback since act may override USERPROFILE to a temp directory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -66,12 +66,21 @@ jobs:
|
||||
- name: Add Rust to PATH
|
||||
shell: powershell
|
||||
run: |
|
||||
$cargoDir = "$env:USERPROFILE\.cargo\bin"
|
||||
if (Test-Path $cargoDir) {
|
||||
Add-Content -Path $env:GITHUB_PATH -Value $cargoDir
|
||||
Write-Host "Added $cargoDir to GITHUB_PATH"
|
||||
} else {
|
||||
Write-Error "Rust not found at $cargoDir — install rustup on this runner first"
|
||||
$candidates = @(
|
||||
"$env:USERPROFILE\.cargo\bin",
|
||||
"C:\Users\$env:USERNAME\.cargo\bin"
|
||||
)
|
||||
$added = $false
|
||||
foreach ($dir in $candidates) {
|
||||
if (Test-Path "$dir\cargo.exe") {
|
||||
Add-Content -Path $env:GITHUB_PATH -Value $dir
|
||||
Write-Host "Added $dir to GITHUB_PATH"
|
||||
$added = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (-not $added) {
|
||||
Write-Error "cargo.exe not found - install rustup on this runner"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user