-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
28 lines (22 loc) · 905 Bytes
/
setup.ps1
File metadata and controls
28 lines (22 loc) · 905 Bytes
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
#!/usr/bin/env pwsh
# ccline one-line installer (PowerShell)
# iwr -useb https://raw.githubusercontent.com/itzTiru/ccline/main/setup.ps1 | iex
$ErrorActionPreference = 'Stop'
$REPO = if ($env:CCLINE_REPO) { $env:CCLINE_REPO } else { 'https://github.com/itzTiru/ccline.git' }
$DEST = if ($env:CCLINE_DEST) { $env:CCLINE_DEST } else { Join-Path $HOME '.ccline' }
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
Write-Error "error: 'git' is required. Install it and retry."
exit 1
}
if (Test-Path (Join-Path $DEST '.git')) {
Write-Host "updating $DEST"
git -C $DEST pull --ff-only
} else {
Write-Host "cloning -> $DEST"
git clone --depth=1 $REPO $DEST
}
& (Join-Path $DEST 'powershell\ccline.ps1') init
Write-Host ""
Write-Host "ccline installed at $DEST"
Write-Host " run 'ccline config' anytime to change segments"
Write-Host " run 'ccline uninstall' to revert"