Resolve only the exact command form shipped before hook paths were shell * quoted. This is an ownership identity for upgrade/uninstall, never a command * that new installations write. */
| 2572 | * quoted. This is an ownership identity for upgrade/uninstall, never a command |
| 2573 | * that new installations write. */ |
| 2574 | static int cbm_resolve_released_hook_command(const char *script_name, char *out, size_t out_sz) { |
| 2575 | if (!script_name || !script_name[0] || !out || out_sz == 0U) { |
| 2576 | return CLI_ERR; |
| 2577 | } |
| 2578 | char env_buf[CLI_BUF_1K]; |
| 2579 | const char *env = cbm_safe_getenv("CLAUDE_CONFIG_DIR", env_buf, sizeof(env_buf), NULL); |
| 2580 | int written = env && env[0] ? snprintf(out, out_sz, "%s/hooks/%s", env, script_name) |
| 2581 | : snprintf(out, out_sz, "~/.claude/hooks/%s", script_name); |
| 2582 | return written > 0 && (size_t)written < out_sz ? CLI_OK : CLI_ERR; |
| 2583 | } |
| 2584 | |
| 2585 | cbm_detected_agents_t cbm_detect_agents(const char *home_dir) { |
| 2586 | cbm_detected_agents_t agents; |
no test coverage detected