-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
35 lines (30 loc) · 1.56 KB
/
Copy pathinstall.ps1
File metadata and controls
35 lines (30 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# kernel-radar one-line installer (Windows PowerShell).
#
# Local clone: .\install.ps1 --target claude
# One-liner: irm https://raw.githubusercontent.com/RL-Align/kernel-radar/main/install.ps1 | iex; krInstall --target all
#
# Override the source repo/ref with $env:KERNEL_RADAR_REPO / $env:KERNEL_RADAR_REF.
# All arguments are forwarded to install.py.
$ErrorActionPreference = "Stop"
$Repo = if ($env:KERNEL_RADAR_REPO) { $env:KERNEL_RADAR_REPO } else { "https://github.com/RL-Align/kernel-radar" }
$Ref = if ($env:KERNEL_RADAR_REF) { $env:KERNEL_RADAR_REF } else { "main" }
$py = (Get-Command python3 -ErrorAction SilentlyContinue) ?? (Get-Command python -ErrorAction SilentlyContinue)
if (-not $py) { Write-Error "kernel-radar: Python 3.8+ is required but was not found on PATH."; exit 1 }
$selfDir = if ($PSScriptRoot) { $PSScriptRoot } else { $null }
$cleanup = $null
if ($selfDir -and (Test-Path (Join-Path $selfDir "install.py"))) {
$src = $selfDir
} else {
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
Write-Error "kernel-radar: git is required to fetch the project."; exit 1
}
$src = Join-Path ([System.IO.Path]::GetTempPath()) ("kernel-radar-" + [System.Guid]::NewGuid().ToString("N"))
$cleanup = $src
Write-Host "Fetching kernel-radar ($Ref) from $Repo ..."
& git clone --quiet --depth 1 --branch $Ref $Repo $src 2>$null
if ($LASTEXITCODE -ne 0) { & git clone --quiet --depth 1 $Repo $src }
}
& $py.Source (Join-Path $src "install.py") @args
$status = $LASTEXITCODE
if ($cleanup) { Remove-Item -Recurse -Force $cleanup }
exit $status