diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-03-27 21:15:00 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-03-29 15:58:42 +0200 |
| commit | d862e56e34ad1a76836cc2716b473a61879f2205 (patch) | |
| tree | bf7279fe478810fca345567fbf6ed5fa1ffa8603 /script/setup-rust.ps1 | |
| parent | d08fbd73e1d1257d87ed21e85fb4dcfc33c094e1 (diff) | |
| download | opencut-d862e56e34ad1a76836cc2716b473a61879f2205.tar.gz | |
feat: init desktop app
Diffstat (limited to 'script/setup-rust.ps1')
| -rw-r--r-- | script/setup-rust.ps1 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/script/setup-rust.ps1 b/script/setup-rust.ps1 new file mode 100644 index 00000000..7fc1b38a --- /dev/null +++ b/script/setup-rust.ps1 @@ -0,0 +1,23 @@ +# Installs the Rust toolchain via rustup. +# Run this before any platform-specific setup script. + +$ErrorActionPreference = "Stop" + +if (Get-Command cargo -ErrorAction SilentlyContinue) { + Write-Output "rustup already installed: $(rustup --version)" + exit 0 +} + +$cargoHome = if ($env:CARGO_HOME) { $env:CARGO_HOME } else { "$env:USERPROFILE\.cargo" } +$rustupExe = "$cargoHome\bin\rustup.exe" + +if (-not (Test-Path $rustupExe)) { + Write-Output "Installing rustup..." + $installer = "$env:TEMP\rustup-init.exe" + Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe" -OutFile $installer + & $installer -y --default-toolchain stable + Remove-Item -Force $installer +} + +$env:PATH = "$cargoHome\bin;$env:PATH" +Write-Output "Rust installed: $(& rustc --version)" |
