-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
28 lines (22 loc) · 1.06 KB
/
Copy pathinstall.ps1
File metadata and controls
28 lines (22 loc) · 1.06 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
# gitb one-line installer for Windows
# Usage (PowerShell):
# irm https://github.com/luolin1024/git-batch/raw/main/install.ps1 | iex
$ErrorActionPreference = "Stop"
$VERSION = "v0.3.1"
$REPO = "luolin1024/git-batch"
$FILE = "gitb.exe"
# Install to ~/bin (create if needed)
$InstallDir = "$HOME\bin"
if (!(Test-Path $InstallDir)) { New-Item -ItemType Directory -Force $InstallDir | Out-Null }
$Dest = "$InstallDir\gitb.exe"
$Url = "https://github.com/$REPO/releases/download/$VERSION/$FILE"
Write-Host "⬇️ Downloading gitb $VERSION..." -ForegroundColor Cyan
Invoke-WebRequest -Uri $Url -OutFile $Dest
# Add ~/bin to PATH if not already there
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($UserPath -notlike "*$InstallDir*") {
[Environment]::SetEnvironmentVariable("Path", "$UserPath;$InstallDir", "User")
Write-Host "✅ Added $InstallDir to PATH (restart terminal to take effect)." -ForegroundColor Green
}
Write-Host "✅ Installed to: $Dest" -ForegroundColor Green
Write-Host "🚀 Run 'gitb --version' to verify." -ForegroundColor Cyan