Commit ce5c63d
fix(plugins): replace mapfile with while-read for bash 3.2 compat (#3636)
`mapfile` is a bash 4.0 builtin and is unavailable on macOS's system
bash 3.2.57. Commit 4d63c18 ("fix(plugins): auto-discover databases
instead of hardcoded list") introduced `mapfile -t PROD_DBS < <(...)`
in both dolt-archive/run.sh and dolt-backup/run.sh. On macOS, every
patrol invocation of these plugins exits 127 with:
line 69: mapfile: command not found (dolt-archive)
line 49: mapfile: command not found (dolt-backup)
Impact: JSONL last-resort recovery layer (dolt-archive) and rsync-style
Dolt backup (dolt-backup) silently fail on macOS. Both plugins are the
operational safety net for beads databases.
The bug is gated by the auto-discovery branch — passing explicit
`--databases foo,bar` takes the IFS/read path and still works, which
likely explains why the regression went unnoticed in manual testing.
The default `DEFAULT_DBS="auto"` triggers the break for all scheduled
runs.
Fix: replace `mapfile -t ARR < <(...)` with the bash 3.2-compatible
`ARR=(); while IFS= read -r line; do ARR+=("$line"); done < <(...)`
pattern. Same fix was previously applied in commits e297e73 and
4c5f269 and subsequently regressed by 4d63c18.
Verified on darwin25 / bash 3.2.57(1)-release:
- plugins/dolt-archive/run.sh auto-discovers 16 production DBs
- plugins/dolt-backup/run.sh --dry-run auto-discovers 16 production DBs
- Both scripts run to completion with exit 0
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 40c43c1 commit ce5c63d
2 files changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
0 commit comments