Commit fb5ae96
authored
fix(hooks): openclaw --with-hooks was a silent no-op
install-hooks.sh's openclaw branch only echoed manual copy instructions and
never touched disk, while every other platform (claude/codex/gemini/pi/hermes)
actually performs the install. bin/install.js's maybeSpawnInstallHooks() only
checks the script's exit code, so this printed "hook 已注入 openclaw" even
though nothing was installed — and per its own comment, code-abyss is the
*only* entry point for openclaw hook injection (abyss CLI deliberately
doesn't handle it), so this meant openclaw users following --with-hooks got
nothing, silently.
The printed manual instruction was also itself broken: `cp .../plugin.js
~/.openclaw/plugins/abyss-hooks.js` flattens the file, but plugin.js resolves
its hook scripts via path.join(__dirname, '..', 'common') — it needs an
`openclaw/` dir with a sibling `common/`, not a loose file. Fixed by mirroring
hermes's own pattern (an actual `cp` into a self-contained plugin directory)
while preserving that directory relationship, so the copied plugin.js's
relative lookup still resolves.
Added test/install-hooks-sh.test.js — this script had zero test coverage
before, which is how a no-op-reported-as-success bug went unnoticed.
Co-authored-by: telagod <telagod@users.noreply.github.com>1 parent 28c0259 commit fb5ae96
2 files changed
Lines changed: 63 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments