mirror of
https://github.com/JuliusBrussee/caveman.git
synced 2026-08-11 13:21:09 +02:00
Installer fixes: #414 (rename PS1 $Args->$InstallerArgs), #437 (detect Copilot via extension dirs, fixes #336), #395 (--skill '*' instead of --all so -a <agent> is honored, fixes #389), #472 (prune orphaned managed hooks from settings.json, fixes #471), #393 (don't double-wire hooks when the plugin manifest already does, fixes #392), #380 (MCP-shrink off by default, requires an upstream, fixes #474), #376 install-side (opencode uses ~/.config/opencode, drop %APPDATA%), #443 (strip tools: from cavecrew agent copies for opencode, #386), #434 (existsSync guard on command copy), #396 (doc: discover profile slugs via --list). Security hardening: #261 (pin remote fetch to release tag PINNED_REF=v1.8.2, not moving main) and #262 (SHA-256-verify downloaded hook files against src/hooks/checksums.sha256 before they execute; abort on mismatch). #260 (inspect-before-run note). NOTE: enforcement activates fully once a release tag shipping checksums.sha256 is published and PINNED_REF is bumped; v1.8.2 predates the manifest so downloads there warn-and-proceed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
63 lines
1.9 KiB
PowerShell
63 lines
1.9 KiB
PowerShell
# caveman — installer shim (Windows / PowerShell).
|
|
#
|
|
# Thin wrapper around bin/install.js (the unified Node installer). Every flag
|
|
# you'd pass to bin/install.js can be passed here; we just forward them.
|
|
#
|
|
# One-line install:
|
|
# irm https://raw.githubusercontent.com/JuliusBrussee/caveman/main/install.ps1 | iex
|
|
#
|
|
# Local clone:
|
|
# pwsh install.ps1 [flags]
|
|
#
|
|
# Why a Node installer? install.sh + install.ps1 used to be parallel sources of
|
|
# truth and constantly drifted (issue #249 was a `node -e "..."` quoting bug
|
|
# that silently dropped the JSON merge step on every Windows install). One
|
|
# Node script works everywhere without quoting bugs.
|
|
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(ValueFromRemainingArguments = $true)]
|
|
[string[]]$InstallerArgs
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$Repo = "JuliusBrussee/caveman"
|
|
|
|
# Require Node ≥18.
|
|
$node = Get-Command node -ErrorAction SilentlyContinue
|
|
if (-not $node) {
|
|
Write-Error @"
|
|
caveman: Node.js (>=18) required. Install:
|
|
- winget install OpenJS.NodeJS.LTS
|
|
- or download from https://nodejs.org
|
|
"@
|
|
exit 1
|
|
}
|
|
|
|
$nodeMajor = [int](& node -p "process.versions.node.split('.')[0]")
|
|
if ($nodeMajor -lt 18) {
|
|
Write-Error "caveman: Node $nodeMajor too old. Need Node >=18. Upgrade: https://nodejs.org"
|
|
exit 1
|
|
}
|
|
|
|
# If we're inside the repo clone, run the local installer directly.
|
|
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$local = Join-Path $here "bin/install.js"
|
|
if (Test-Path $local) {
|
|
& node $local @InstallerArgs
|
|
exit $LASTEXITCODE
|
|
}
|
|
|
|
# Curl-pipe path: delegate to npx.
|
|
$npx = Get-Command npx -ErrorAction SilentlyContinue
|
|
if (-not $npx) {
|
|
Write-Error "caveman: npx required (ships with Node >=18). Reinstall Node.js."
|
|
exit 1
|
|
}
|
|
|
|
# Do NOT pass `--` here — npm 7+ npx already forwards trailing args to the
|
|
# package, and a literal `--` was tripping bin/install.js's parseArgs as an
|
|
# unknown flag.
|
|
& npx -y "github:$Repo" @InstallerArgs
|
|
exit $LASTEXITCODE
|