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
|
- name: Add Rust to PATH
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$cargoDir = "$env:USERPROFILE\.cargo\bin"
|
$candidates = @(
|
||||||
if (Test-Path $cargoDir) {
|
"$env:USERPROFILE\.cargo\bin",
|
||||||
Add-Content -Path $env:GITHUB_PATH -Value $cargoDir
|
"C:\Users\$env:USERNAME\.cargo\bin"
|
||||||
Write-Host "Added $cargoDir to GITHUB_PATH"
|
)
|
||||||
} else {
|
$added = $false
|
||||||
Write-Error "Rust not found at $cargoDir — install rustup on this runner first"
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user