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
| 9515 | * best-effort — the behaviour does not depend on recognising it, only the |
| 9516 | * wording does. */ |
| 9517 | static const char *cli_external_manager_name(const char *self_path) { |
| 9518 | if (!self_path || !self_path[0]) { |
| 9519 | return NULL; |
| 9520 | } |
| 9521 | if (strstr(self_path, "/mise/") || strstr(self_path, "/.mise/")) { |
| 9522 | return "mise"; |
| 9523 | } |
| 9524 | if (strstr(self_path, "/Cellar/") || strstr(self_path, "/homebrew/") || |
| 9525 | strstr(self_path, "/linuxbrew/")) { |
| 9526 | return "Homebrew"; |
| 9527 | } |
| 9528 | if (strstr(self_path, "/nix/store/")) { |
| 9529 | return "nix"; |
| 9530 | } |
| 9531 | if (strstr(self_path, "/.asdf/")) { |
| 9532 | return "asdf"; |
| 9533 | } |
| 9534 | if (strstr(self_path, "/.cargo/bin/")) { |
| 9535 | return "cargo"; |
| 9536 | } |
| 9537 | return NULL; |
| 9538 | } |
| 9539 | |
| 9540 | #ifdef CBM_CLI_ENABLE_TEST_API |
| 9541 | const char *cbm_cli_external_manager_name_for_testing(const char *self_path) { |
no outgoing calls
no test coverage detected