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. */
| 2615 | * quoted. This is an ownership identity for upgrade/uninstall, never a command |
| 2616 | * that new installations write. */ |
| 2617 | static int cbm_resolve_released_hook_command(const char *script_name, char *out, size_t out_sz) { |
| 2618 | if (!script_name || !script_name[0] || !out || out_sz == 0U) { |
| 2619 | return CLI_ERR; |
| 2620 | } |
| 2621 | char env_buf[CLI_BUF_1K]; |
| 2622 | const char *env = cbm_safe_getenv("CLAUDE_CONFIG_DIR", env_buf, sizeof(env_buf), NULL); |
| 2623 | int written = env && env[0] ? snprintf(out, out_sz, "%s/hooks/%s", env, script_name) |
| 2624 | : snprintf(out, out_sz, "~/.claude/hooks/%s", script_name); |
| 2625 | return written > 0 && (size_t)written < out_sz ? CLI_OK : CLI_ERR; |
| 2626 | } |
| 2627 | |
| 2628 | cbm_detected_agents_t cbm_detect_agents(const char *home_dir) { |
| 2629 | cbm_detected_agents_t agents; |
no test coverage detected