mirror of
https://github.com/gnekt/My-Brain-Is-Full-Crew.git
synced 2026-09-08 14:56:20 +00:00
build: add platform_dir and dispatcher_name to all hook wrapper/plugin templates feat(hooks): platform-aware path checks using platform_dir and dispatcher_name from JSON input test: update regression snapshot for platform-aware hook wrappers and scripts
25 lines
855 B
Bash
Executable File
25 lines
855 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# =============================================================================
|
|
# Generated by adapters/gemini-cli/adapter.sh — do not edit.
|
|
# Wrapper for hook: __HOOK_NAME__
|
|
# Reads Gemini CLI native JSON from stdin, translates it into the neutral
|
|
# schema, and pipes the result to __HOOK_NAME__.sh.
|
|
# =============================================================================
|
|
set -eo pipefail
|
|
|
|
INPUT=$(cat)
|
|
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
NEUTRAL=$(echo "$INPUT" | jq -c '{
|
|
event: "__EVENT_NAME__",
|
|
tool: (.tool_name // ""),
|
|
args: (.tool_input // {}),
|
|
session_id: (env.GEMINI_SESSION_ID // ""),
|
|
cwd: (env.GEMINI_CWD // env.GEMINI_PROJECT_DIR // ""),
|
|
framework: "gemini-cli",
|
|
platform_dir: ".gemini",
|
|
dispatcher_name: "GEMINI.md"
|
|
}')
|
|
|
|
echo "$NEUTRAL" | bash "$HOOK_DIR/__HOOK_NAME__.sh"
|