MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_resolve_released_hook_command

Function cbm_resolve_released_hook_command

src/cli/cli.c:2526–2535  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

2524 * quoted. This is an ownership identity for upgrade/uninstall, never a command
2525 * that new installations write. */
2526static int cbm_resolve_released_hook_command(const char *script_name, char *out, size_t out_sz) {
2527 if (!script_name || !script_name[0] || !out || out_sz == 0U) {
2528 return CLI_ERR;
2529 }
2530 char env_buf[CLI_BUF_1K];
2531 const char *env = cbm_safe_getenv("CLAUDE_CONFIG_DIR", env_buf, sizeof(env_buf), NULL);
2532 int written = env && env[0] ? snprintf(out, out_sz, "%s/hooks/%s", env, script_name)
2533 : snprintf(out, out_sz, "~/.claude/hooks/%s", script_name);
2534 return written > 0 && (size_t)written < out_sz ? CLI_OK : CLI_ERR;
2535}
2536
2537cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
2538 cbm_detected_agents_t agents;

Calls 1

cbm_safe_getenvFunction · 0.85

Tested by

no test coverage detected