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

Function cbm_build_augment_coverage_script

src/cli/cli.c:4814–4844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4812}
4813
4814static int cbm_build_augment_coverage_script(const char *binary_path, char *script,
4815 size_t script_size) {
4816 if (!binary_path || !script || script_size == 0U) {
4817 return CLI_ERR;
4818 }
4819 char quoted[CLI_BUF_8K];
4820#ifdef _WIN32
4821 if (cbm_powershell_quote_word(binary_path, quoted, sizeof(quoted)) != CLI_OK) {
4822 return CLI_ERR;
4823 }
4824 int written = snprintf(script, script_size,
4825 "# PostToolUse view adapter installed by codebase-memory-mcp.\n"
4826 "$bin = %s\n"
4827 "if (-not (Test-Path -LiteralPath $bin -PathType Leaf)) { exit 0 }\n"
4828 "& $bin hook-augment --dialect augment 2>$null\n"
4829 "exit 0\n",
4830 quoted);
4831#else
4832 if (cbm_shell_quote_word(binary_path, quoted, sizeof(quoted)) != CLI_OK) {
4833 return CLI_ERR;
4834 }
4835 int written = snprintf(script, script_size,
4836 "#!/bin/sh\n"
4837 "# PostToolUse view adapter installed by codebase-memory-mcp.\n"
4838 "BIN=%s\n"
4839 "[ -x \"$BIN\" ] || exit 0\n"
4840 "exec \"$BIN\" hook-augment --dialect augment 2>/dev/null\n",
4841 quoted);
4842#endif
4843 return written > 0 && (size_t)written < script_size ? CLI_OK : CLI_ERR;
4844}
4845
4846static bool cbm_install_augment_coverage_script(const char *binary_path, const char *script_path) {
4847 char script[CLI_BUF_8K];

Calls 2

cbm_shell_quote_wordFunction · 0.85

Tested by

no test coverage detected