fix(ci): fix PowerShell parse error in Add Rust to PATH step
Build Lotus Chat Desktop / prepare (push) Successful in 25s
Build Lotus Chat Desktop / build-windows (push) Failing after 16m57s
Build Lotus Chat Desktop / build-linux (push) Successful in 23m50s
Build Lotus Chat Desktop / update-manifest (push) Has been skipped

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:
2026-06-14 21:37:25 -04:00
parent 83725e1a2a
commit fd565e1edc
+15 -6
View File
@@ -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
}