fix: herdr integrations make the hook directory herdr names
herdr writes its hook file but not the directory, so on a fresh box `herdr integration install omp` failed: omp had never created ~/.omp/agent/extensions. The step now reads the target path from `herdr integration status` and makes its directory, only for an agent that is present. The fake herdr fails like the real one when it is missing.
This commit is contained in:
1 parent
c710e1934d
commit
06b03c9528
3 files changed
+54
-11
No files matched your search
+18
-4
@@ -145,16 +145,30 @@ go)
|
||||
herdr)
|
||||
# `herdr integration status` lists one `<agent>: <state> (...)` line per
|
||||
# integration; FAKE_HERDR_CURRENT names the agents to report `current`,
|
||||
# every other one is `not installed`. `install` is only logged.
|
||||
# every other one is `not installed`. The paths are the real ones' shape.
|
||||
# `install` writes nothing, but like the real herdr it fails when the
|
||||
# target's directory is missing: herdr does not create ~/.omp/agent/extensions.
|
||||
_herdr_target() {
|
||||
case $1 in
|
||||
pi) echo "$HOME/.pi/agent/extensions/herdr-agent-state.ts" ;;
|
||||
omp) echo "$HOME/.omp/agent/extensions/herdr-omp-agent-state.ts" ;;
|
||||
claude) echo "$HOME/.claude/hooks/herdr-agent-state.sh" ;;
|
||||
codex) echo "$HOME/.codex/herdr-agent-state.sh" ;;
|
||||
*) echo "$HOME/.$1/hooks/herdr-agent-state.sh" ;;
|
||||
esac
|
||||
}
|
||||
case ${1:-}:${2:-} in
|
||||
integration:status)
|
||||
for _a in pi omp claude codex copilot; do
|
||||
case " ${FAKE_HERDR_CURRENT:-} " in
|
||||
*" $_a "*) printf '%s: current (v11) (%s/.fake/%s)\n' "$_a" "$HOME" "$_a" ;;
|
||||
*) printf '%s: not installed (%s/.fake/%s)\n' "$_a" "$HOME" "$_a" ;;
|
||||
*" $_a "*) printf '%s: current (v11) (%s)\n' "$_a" "$(_herdr_target "$_a")" ;;
|
||||
*) printf '%s: not installed (%s)\n' "$_a" "$(_herdr_target "$_a")" ;;
|
||||
esac
|
||||
done ;;
|
||||
integration:install) [ "$mode" = install ] && exit 1 ;;
|
||||
integration:install)
|
||||
[ "$mode" = install ] && exit 1
|
||||
_t=$(_herdr_target "${3:-}")
|
||||
[ -d "${_t%/*}" ] || { echo "error: ${_t%/*}: No such file or directory" >&2; exit 1; } ;;
|
||||
esac
|
||||
exit 0 ;;
|
||||
nvim)
|
||||
|
||||
Reference in new issue
Block a user