Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.
Shell agent-teamsai-agentai-automationanthropicautonomous-agentawsbusiness-operationsclaudeclaude-codeclaude-code-plugindevopsecommerceinbox-zeroklaviyomarketingmcpmorning-briefingpr-automationshopifyterminal
fix(installer): honour --dry-run for binstubs; add Bash 4 shim to preflight (#1013)
TogithaNisala1ff10f46ddd
diff --git a/claude-ops/bin/ops-setup-preflight b/claude-ops/bin/ops-setup-preflightindex 1057c56a..c1b4b31b 100755--- a/claude-ops/bin/ops-setup-preflight+++ b/claude-ops/bin/ops-setup-preflight@@ -1,6 +1,21 @@#!/usr/bin/env bash# ops-setup-preflight — gather all setup data in parallel (runs in background)# Results written to /tmp/ops-preflight/ for the setup wizard to read++# macOS still ships Bash 3.2, and the Telegram probe below uses an associative+# array. That probe runs as a background job, so under 3.2 it dies quietly and+# the wizard sees a complete-looking result directory with telegram.txt missing.+# Repair the interpreter boundary here, the same way bin/ops-status does.+if (( BASH_VERSINFO[0] < 4 )); then+ for modern_bash in /opt/homebrew/bin/bash /usr/local/bin/bash; do+ if [ -x "$modern_bash" ] && "$modern_bash" -c '(( BASH_VERSINFO[0] >= 4 ))' 2>/dev/null; then+ exec "$modern_bash" "$0" "$@"+ fi+ done+ printf 'ops-setup-preflight: Bash 4+ is required (found %s)\n' "$BASH_VERSION" >&2+ exit 69+fi+set -euo pipefailSCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"diff --git a/installer/src/bin.mjs b/installer/src/bin.mjsindex 66719059..44ce5a08 100644--- a/installer/src/bin.mjs+++ b/installer/src/bin.mjs@@ -76,14 +76,20 @@ export function planBinLinks({ srcDir, binPath, binNames, force }) {return { planned, refused, errors };}-export function applyBinLinks({ binPath, plan, onApply }) {+export function applyBinLinks({ binPath, plan, onApply, dryRun }) {const results = [];- fs.mkdirSync(binPath, { recursive: true });+ // Creating binPath is itself a mutation — on a fresh host this is what brings+ // ~/bin into existence, so it has to sit behind the dryRun guard too.+ if (!dryRun) fs.mkdirSync(binPath, { recursive: true });for (const r of plan.planned) {if (r.status !== "planned") {results.push(r);continue;}+ if (dryRun) {+ results.push(r);+ continue;+ }try {let st = null;try {diff --git a/installer/src/dispatch.mjs b/installer/src/dispatch.mjsindex bbdedfbf..4f0f35b5 100644--- a/installer/src/dispatch.mjs+++ b/installer/src/dispatch.mjs@@ -219,6 +219,7 @@ function applyAll({ plan, dryRun, cfg }) {applyBinLinks({binPath: cfg.bin.path,plan: plan.bin,+ dryRun,onApply: (to, from) => addSymlink(manifest, to, from),});}diff --git a/installer/test/smoke.mjs b/installer/test/smoke.mjsindex b3c6f50f..1cf4f9ea 100644--- a/installer/test/smoke.mjs+++ b/installer/test/smoke.mjs@@ -112,6 +112,34 @@ try {"ops-inbox-scan binstub present in scratch",);+ // 3b. applyBinLinks honours dryRun. Regression: it used to take no dryRun+ // param at all, so `install --dry-run` created the bin dir and every symlink+ // for real — and, because the manifest is only saved when !dryRun, left them+ // untracked and beyond the reach of `uninstall`.+ const dryBin = path.join(scratch, "bin-dry");+ const dryPlan = planBinLinks({+ srcDir: SRC,+ binPath: dryBin,+ binNames: bins,+ force: false,+ });+ const dryManifest = newManifest();+ applyBinLinks({+ binPath: dryBin,+ plan: dryPlan,+ dryRun: true,+ onApply: (to, from) => addSymlink(dryManifest, to, from),+ });+ assert(!fs.existsSync(dryBin), "dry-run does not create the bin directory");+ assert(+ dryManifest.symlinks.length === 0,+ `dry-run records nothing in the manifest (got ${dryManifest.symlinks.length})`,+ );+ assert(+ dryPlan.planned.every((r) => r.status === "planned"),+ "dry-run leaves every entry at status=planned",+ );+// 4. Detection-gated planning skips undetected agents by default.const detectedPath = path.join(scratch, "detected-agent");const undetectedPath = path.join(scratch, "undetected-agent");