Files
zed/script/install-rustup.ps1
T
Mohamad KhaniandClaude Fable 5 46c7879954 logiguard fork v2: patched GPUI on verified 8c74db0 tree
Rebuilt from the exact zed-industries/zed @ 8c74db00c4053d6c0a9037863d7bd048658da4ca
tree (previous orphan was based on a stale/wrong fetch). Same 3-file patch:
  - serial.rs: add SerialKind::KeyboardEnter
  - client.rs: store wl_keyboard.enter serial; add latest_serial_of()
  - window.rs: activate() uses keyboard-enter serial (Mutter focus gate)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 01:44:22 +03:30

40 lines
1.3 KiB
PowerShell

# Checks if cargo is in the user's path or in default install path
# If not, download with rustup-installer (which respects CARGO_HOME / RUSTUP_HOME)
# Like 'set -e' in bash
$ErrorActionPreference = "Stop"
$cargoHome = if ($env:CARGO_HOME) { $env:CARGO_HOME } else { "$env:USERPROFILE\.cargo" }
$rustupPath = "$cargoHome\bin\rustup.exe"
$cargoPath = "$cargoHome\bin\cargo.exe"
# Check if cargo is already available in path
if (Get-Command cargo -ErrorAction SilentlyContinue)
{
cargo --version
exit
}
# Check if rustup and cargo are available in CARGO_HOME
elseif (-not ((Test-Path $rustupPath) -and (Test-Path $cargoPath))) {
Write-Output "Rustup or Cargo not found in $cargoHome, installing..."
$tempDir = [System.IO.Path]::GetTempPath()
# Download and install rustup
$RustupInitPath = "$tempDir\rustup-init.exe"
Write-Output "Downloading rustup installer..."
Invoke-WebRequest `
-OutFile $RustupInitPath `
-Uri https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe
Write-Output "Installing rustup..."
& $RustupInitPath -y --default-toolchain none
Remove-Item -Force $RustupInitPath
Write-Output "Rust installation complete."
# This is necessary
}
& $rustupPath --version
& $cargoPath --version