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. */
| 2530 | * quoted. This is an ownership identity for upgrade/uninstall, never a command |
| 2531 | * that new installations write. */ |
| 2532 | static int cbm_resolve_released_hook_command(const char *script_name, char *out, size_t out_sz) { |
| 2533 | if (!script_name || !script_name[0] || !out || out_sz == 0U) { |
| 2534 | return CLI_ERR; |
| 2535 | } |
| 2536 | char env_buf[CLI_BUF_1K]; |
| 2537 | const char *env = cbm_safe_getenv("CLAUDE_CONFIG_DIR", env_buf, sizeof(env_buf), NULL); |
| 2538 | int written = env && env[0] ? snprintf(out, out_sz, "%s/hooks/%s", env, script_name) |
| 2539 | : snprintf(out, out_sz, "~/.claude/hooks/%s", script_name); |
| 2540 | return written > 0 && (size_t)written < out_sz ? CLI_OK : CLI_ERR; |
| 2541 | } |
| 2542 | |
| 2543 | cbm_detected_agents_t cbm_detect_agents(const char *home_dir) { |
| 2544 | cbm_detected_agents_t agents; |
no test coverage detected