Update mempal-stop-hook.sh
This commit is contained in:
@@ -1,5 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# MemPalace Stop Hook — thin wrapper calling Python CLI
|
# MemPalace Stop Hook — thin wrapper calling Python CLI
|
||||||
# All logic lives in mempalace.hooks_cli for cross-harness extensibility
|
# All logic lives in mempalace.hooks_cli for cross-harness extensibility
|
||||||
INPUT=$(cat)
|
run_mempalace_hook() {
|
||||||
echo "$INPUT" | python3 -m mempalace hook run --hook stop --harness claude-code
|
if command -v mempalace >/dev/null 2>&1; then
|
||||||
|
mempalace hook run "$@"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v python3 >/dev/null 2>&1 && python3 -c "import mempalace" >/dev/null 2>&1; then
|
||||||
|
python3 -m mempalace hook run "$@"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v python >/dev/null 2>&1 && python -c "import mempalace" >/dev/null 2>&1; then
|
||||||
|
python -m mempalace hook run "$@"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "MemPalace hook error: could not find a runnable mempalace command or module" >&2
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
run_mempalace_hook --hook stop --harness claude-code
|
||||||
|
|||||||
Reference in New Issue
Block a user