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
| 9453 | * best-effort — the behaviour does not depend on recognising it, only the |
| 9454 | * wording does. */ |
| 9455 | static 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 |
| 9479 | const char *cbm_cli_external_manager_name_for_testing(const char *self_path) { |
no outgoing calls
no test coverage detected