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
| 9680 | * best-effort — the behaviour does not depend on recognising it, only the |
| 9681 | * wording does. */ |
| 9682 | static const char *cli_external_manager_name(const char *self_path) { |
| 9683 | if (!self_path || !self_path[0]) { |
| 9684 | return NULL; |
| 9685 | } |
| 9686 | if (strstr(self_path, "/mise/") || strstr(self_path, "/.mise/")) { |
| 9687 | return "mise"; |
| 9688 | } |
| 9689 | if (strstr(self_path, "/Cellar/") || strstr(self_path, "/homebrew/") || |
| 9690 | strstr(self_path, "/linuxbrew/")) { |
| 9691 | return "Homebrew"; |
| 9692 | } |
| 9693 | if (strstr(self_path, "/nix/store/")) { |
| 9694 | return "nix"; |
| 9695 | } |
| 9696 | if (strstr(self_path, "/.asdf/")) { |
| 9697 | return "asdf"; |
| 9698 | } |
| 9699 | if (strstr(self_path, "/.cargo/bin/")) { |
| 9700 | return "cargo"; |
| 9701 | } |
| 9702 | return NULL; |
| 9703 | } |
| 9704 | |
| 9705 | #ifdef CBM_CLI_ENABLE_TEST_API |
| 9706 | const char *cbm_cli_external_manager_name_for_testing(const char *self_path) { |
no outgoing calls
no test coverage detected