mirror of
https://github.com/JuliusBrussee/caveman.git
synced 2026-08-11 13:21:09 +02:00
Brings the long-stashed Node installer onto main. install.sh and install.ps1
shrink to thin shims (~50 lines each) that delegate to bin/install.js, fixing
the cross-platform drift that caused #249-class quoting bugs.
- bin/install.js (850 lines) — unified PROVIDERS-driven installer
- bin/lib/settings.js (221 lines) — JSONC parser + hook validator
(validateHookFields prevents single bad hook from poisoning settings.json)
- tests/installer/{unit.argv,unit.settings,e2e.dryrun}.test.mjs — npm test
now actually runs four real tests (was silently passing 0)
- .agents/skills/cavecrew, .junie/, .kiro/, .roo/ — per-agent skill mirrors
- skills-lock.json — vercel-labs/skills slug pinning
- install.{sh,ps1}.legacy escape hatch dropped (git history is the fallback)
- Minor cavecrew agent description refinements
Closes the gap between docs (already merged) describing bin/install.js and
the actual implementation.
60 lines
1.7 KiB
PowerShell
60 lines
1.7 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[]]$Args
|
|
)
|
|
|
|
$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 @Args
|
|
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
|
|
}
|
|
|
|
& npx -y "github:$Repo" -- @Args
|
|
exit $LASTEXITCODE
|