-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
37 lines (31 loc) · 1.17 KB
/
Copy pathinstall.ps1
File metadata and controls
37 lines (31 loc) · 1.17 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
# Install git-bash-opencode-plugin (global OpenCode plugin)
# Usage:
# powershell -ExecutionPolicy Bypass -File .\install.ps1
[CmdletBinding()]
param()
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
function Invoke-NodeScript {
param([string]$ScriptPath)
$node = Get-Command node -ErrorAction SilentlyContinue
if ($node) {
& node $ScriptPath
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
return
}
$bun = Get-Command bun -ErrorAction SilentlyContinue
if ($bun) {
& bun run $ScriptPath
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
return
}
Write-Host "Node.js or Bun is required." -ForegroundColor Red
exit 1
}
Write-Host "git-bash-opencode-plugin installer" -ForegroundColor Cyan
Write-Host "===================================" -ForegroundColor Cyan
Write-Host "`nInstalling global OpenCode plugin..." -ForegroundColor Green
Invoke-NodeScript "$PSScriptRoot\scripts\install-global.mjs"
Write-Host "`nDone! Restart OpenCode to activate the plugin." -ForegroundColor Green
Write-Host 'Verify: opencode run "call bashInfo and show the result"' -ForegroundColor White