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

Function cli_external_manager_name

src/cli/cli.c:9455–9476  ·  view source on GitHub ↗

Is the running binary owned by an external package manager rather than by us? * * #1566: cbm's installer does two separable jobs — place the binary (and put its * directory on PATH), and configure the agents. For someone who installed * through mise, Homebrew or nix, the first job is not merely redundant: it drops * a SECOND copy into ~/.local/bin that shadows the managed one depending on PAT

Source from the content-addressed store, hash-verified

9453 * best-effort — the behaviour does not depend on recognising it, only the
9454 * wording does. */
9455static const char *cli_external_manager_name(const char *self_path) {
9456 if (!self_path || !self_path[0]) {
9457 return NULL;
9458 }
9459 if (strstr(self_path, "/mise/") || strstr(self_path, "/.mise/")) {
9460 return "mise";
9461 }
9462 if (strstr(self_path, "/Cellar/") || strstr(self_path, "/homebrew/") ||
9463 strstr(self_path, "/linuxbrew/")) {
9464 return "Homebrew";
9465 }
9466 if (strstr(self_path, "/nix/store/")) {
9467 return "nix";
9468 }
9469 if (strstr(self_path, "/.asdf/")) {
9470 return "asdf";
9471 }
9472 if (strstr(self_path, "/.cargo/bin/")) {
9473 return "cargo";
9474 }
9475 return NULL;
9476}
9477
9478#ifdef CBM_CLI_ENABLE_TEST_API
9479const char *cbm_cli_external_manager_name_for_testing(const char *self_path) {

Callers 4

cbm_cmd_installFunction · 0.85
cbm_cmd_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected