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:3110–3119  ·  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

3108 * quoted. This is an ownership identity for upgrade/uninstall, never a command
3109 * that new installations write. */
3110static int cbm_resolve_released_hook_command(const char *script_name, char *out, size_t out_sz) {
3111 if (!script_name || !script_name[0] || !out || out_sz == 0U) {
3112 return CLI_ERR;
3113 }
3114 char env_buf[CLI_BUF_1K];
3115 const char *env = cbm_safe_getenv("CLAUDE_CONFIG_DIR", env_buf, sizeof(env_buf), NULL);
3116 int written = env && env[0] ? snprintf(out, out_sz, "%s/hooks/%s", env, script_name)
3117 : snprintf(out, out_sz, "~/.claude/hooks/%s", script_name);
3118 return written > 0 && (size_t)written < out_sz ? CLI_OK : CLI_ERR;
3119}
3120
3121/* #1180: a bare ~/.claude directory is not a Claude Code install -- other
3122 * tools create it -- and treating it as one wrote hooks, skills and MCP

Calls 1

cbm_safe_getenvFunction · 0.85

Tested by

no test coverage detected