Skip to content

Commit 4777801

Browse files
committed
Add script to install rust
1 parent 9577e5f commit 4777801

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

FastData.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<Folder Name="/_Scripts/">
8383
<File Path="Scripts/Build.ps1" />
8484
<File Path="Scripts/Install-Gcc.ps1" />
85+
<File Path="Scripts/Install-Rust.ps1" />
8586
<File Path="Scripts/Publish.ps1" />
8687
</Folder>
8788
<Project Path="Src/FastData.Benchmarks/FastData.Benchmarks.csproj" />

Scripts/Install-Rust.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
$Color = "DarkBlue"
2+
3+
Write-Host -ForegroundColor $Color "Checking rustc availability"
4+
5+
$rustc = Get-Command rustc -ErrorAction SilentlyContinue
6+
if ($rustc) {
7+
Write-Host -ForegroundColor $Color "rustc found: $($rustc.Source)"
8+
exit 0
9+
}
10+
11+
Write-Host -ForegroundColor $Color "Installing Rust (rustc) via winget"
12+
13+
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
14+
Write-Host -ForegroundColor Red "winget not found. Install App Installer from Microsoft Store."
15+
exit 1
16+
}
17+
18+
winget install -e --id Rustlang.Rustup --accept-package-agreements --accept-source-agreements
19+
20+
$rustc = Get-Command rustc -ErrorAction SilentlyContinue
21+
if ($rustc) {
22+
Write-Host -ForegroundColor $Color "rustc found: $($rustc.Source)"
23+
exit 0
24+
}
25+
26+
Write-Host -ForegroundColor Yellow "rustc not found on PATH after installation. Restart PowerShell and try again."

0 commit comments

Comments
 (0)