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:4752–4782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4750}
4751
4752static int cbm_build_augment_coverage_script(const char *binary_path, char *script,
4753 size_t script_size) {
4754 if (!binary_path || !script || script_size == 0U) {
4755 return CLI_ERR;
4756 }
4757 char quoted[CLI_BUF_8K];
4758#ifdef _WIN32
4759 if (cbm_powershell_quote_word(binary_path, quoted, sizeof(quoted)) != CLI_OK) {
4760 return CLI_ERR;
4761 }
4762 int written = snprintf(script, script_size,
4763 "# PostToolUse view adapter installed by codebase-memory-mcp.\n"
4764 "$bin = %s\n"
4765 "if (-not (Test-Path -LiteralPath $bin -PathType Leaf)) { exit 0 }\n"
4766 "& $bin hook-augment --dialect augment 2>$null\n"
4767 "exit 0\n",
4768 quoted);
4769#else
4770 if (cbm_shell_quote_word(binary_path, quoted, sizeof(quoted)) != CLI_OK) {
4771 return CLI_ERR;
4772 }
4773 int written = snprintf(script, script_size,
4774 "#!/bin/sh\n"
4775 "# PostToolUse view adapter installed by codebase-memory-mcp.\n"
4776 "BIN=%s\n"
4777 "[ -x \"$BIN\" ] || exit 0\n"
4778 "exec \"$BIN\" hook-augment --dialect augment 2>/dev/null\n",
4779 quoted);
4780#endif
4781 return written > 0 && (size_t)written < script_size ? CLI_OK : CLI_ERR;
4782}
4783
4784static bool cbm_install_augment_coverage_script(const char *binary_path, const char *script_path) {
4785 char script[CLI_BUF_8K];

Calls 2

cbm_shell_quote_wordFunction · 0.85

Tested by

no test coverage detected