Stock macOS ships bash 3.2 (frozen 2007 due to GPLv3) and BSD find. Both scripts used `mapfile` (bash 4+) and `find -printf` (GNU only), so a fresh Mac user running `bash scripts/install.sh` died on line 11 before copying anything. Replace with a portable shell glob — same sort order, no `find` dependency, works on bash 3.2 and 4+. Verified on git-bash: 16 skills discovered, install dry-run copies all, `build.sh` produces a valid archive. See .wiki/concepts/install-portability.md for the full gotcha. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.9 KiB
1.9 KiB
mac-support-scripts
Goal
Make scripts/install.sh and scripts/build.sh work on stock macOS (BSD find, bash 3.2). Currently both use mapfile (bash 4+) and find -printf (GNU-only) — fatal on a fresh Mac. Without the fix, the README's "Linux / macOS (bash)" quick-start is a lie.
Key files
scripts/install.sh:11—mapfile -t names < <(find ... -printf ...)scripts/build.sh:18— same patternREADME.md:30-38— claims macOS bash quick-start works.wiki/concepts/build-notes.md— companion concept page; add a sibling for the install-script portability gotcha
Decisions log
- 2026-04-28: Replace
mapfile+find -printfwith shell glob (for d in "$SRC"/*/). Reason: works in bash 3.2 (stock macOS) and avoids afindflavor dependency. Alternative — requirebash 4+via#!/usr/bin/env bash+ version check — rejected: pushes the burden onto Mac users, who would needbrew install bashfor a 30-line script. - 2026-04-28: Don't drop the
set -euo pipefailline — POSIX-ish bash supports it from 3.x. - 2026-04-28: Final — patched both scripts; verified on git-bash (
bash -nclean, install dry-run installs all 16 skills sorted alphabetically into temp dir,build.sh active-platformproduces a valid.skillarchive); wrote.wiki/concepts/install-portability.md; index + log updated; dist/ unchanged (smoke-rebuild was byte-identical so no dist churn).
Open questions
- None — done.
Completed steps
- Identify bugs
- Pick fix approach (shell glob, no new deps)
- Patch
scripts/install.sh - Patch
scripts/build.sh - Verify on git-bash (
bash -n+ install dry-run + build smoke-test) - Wiki concept page (
install-portability.md) + index + log - Commit
Notes
basenameis in POSIX, fine on Mac.- Empty
skills/would have"$SRC"/*/literal under bash 3.2 withoutnullglob. Guard with[ -d "$d" ] || continue— works withoutshopt.