Improve Windows update parity
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
This commit is contained in:
+19
-1
@@ -24,6 +24,24 @@ function Require-Command($Name) {
|
||||
}
|
||||
}
|
||||
|
||||
function Ensure-Cargo {
|
||||
if (Get-Command cargo -ErrorAction SilentlyContinue) {
|
||||
return
|
||||
}
|
||||
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
|
||||
throw "cargo not found and winget is unavailable; install Rust from https://rustup.rs or set DOSH_USE_PREBUILT=1"
|
||||
}
|
||||
Write-Host "cargo not found; installing Rust toolchain with winget/rustup"
|
||||
winget install --id Rustlang.Rustup -e --accept-package-agreements --accept-source-agreements
|
||||
$cargoBin = Join-Path $HOME ".cargo\bin"
|
||||
if (Test-Path $cargoBin) {
|
||||
$env:Path = "$cargoBin;$env:Path"
|
||||
}
|
||||
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) {
|
||||
throw "cargo was installed but is not available in this terminal yet; open a new terminal and rerun dosh update"
|
||||
}
|
||||
}
|
||||
|
||||
function Normalize-Arch {
|
||||
$arch = if ($env:PROCESSOR_ARCHITEW6432) { $env:PROCESSOR_ARCHITEW6432 } else { $env:PROCESSOR_ARCHITECTURE }
|
||||
switch ($arch) {
|
||||
@@ -367,7 +385,7 @@ function Install-Prebuilt {
|
||||
}
|
||||
|
||||
function Install-FromSource {
|
||||
Require-Command cargo
|
||||
Ensure-Cargo
|
||||
if (Test-Path "Cargo.toml") {
|
||||
$src = (Get-Location).Path
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user