-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.ps1
More file actions
62 lines (50 loc) · 2.11 KB
/
install.ps1
File metadata and controls
62 lines (50 loc) · 2.11 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Conductor CLI Installer for Windows
# Usage: irm https://raw.githubusercontent.com/conductor-oss/conductor-cli/main/install.ps1 | iex
$ErrorActionPreference = "Stop"
Write-Host "Installing Conductor CLI..." -ForegroundColor Cyan
# Get latest version from GitHub
try {
$release = Invoke-RestMethod "https://api.github.com/repos/conductor-oss/conductor-cli/releases/latest"
$version = $release.tag_name
} catch {
Write-Host "Error: Failed to fetch latest version from GitHub" -ForegroundColor Red
exit 1
}
Write-Host "Latest version: $version"
# Detect architecture
$arch = if ([Environment]::Is64BitOperatingSystem) { "amd64" } else { "arm64" }
Write-Host "Architecture: windows_$arch"
# Download URL
$url = "https://github.com/conductor-oss/conductor-cli/releases/download/$version/conductor_windows_$arch.exe"
# Install directory (user-local, no admin required)
$installDir = "$env:LOCALAPPDATA\conductor"
# Create directory if it doesn't exist
if (!(Test-Path $installDir)) {
New-Item -ItemType Directory -Force -Path $installDir | Out-Null
}
$exePath = "$installDir\conductor.exe"
# Download the binary
Write-Host "Downloading from $url..."
try {
Invoke-WebRequest -Uri $url -OutFile $exePath -UseBasicParsing
} catch {
Write-Host "Error: Failed to download conductor CLI" -ForegroundColor Red
exit 1
}
# Add to user PATH if not already there
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($userPath -notlike "*$installDir*") {
Write-Host "Adding $installDir to user PATH..."
[Environment]::SetEnvironmentVariable("Path", "$userPath;$installDir", "User")
$env:Path = "$env:Path;$installDir"
}
# Verify installation
Write-Host ""
Write-Host "Conductor CLI $version installed successfully!" -ForegroundColor Green
Write-Host "Location: $exePath"
Write-Host ""
Write-Host "Restart your terminal, then run:" -ForegroundColor Yellow
Write-Host ""
Write-Host "Get started:" -ForegroundColor Green
Write-Host " conductor server start Start a local Conductor server" -ForegroundColor Yellow
Write-Host " conductor --help See all available commands" -ForegroundColor Yellow