pub enum InstallMethod {
Npm,
Homebrew,
Cargo,
Binary,
}Expand description
The package manager (if any) that owns the running executable.
Variants§
Npm
Global npm install — the codewhale package under node_modules.
Homebrew
Homebrew — a binary under a Cellar or linuxbrew prefix.
Cargo
cargo install — a binary under ~/.cargo/bin.
Binary
A release binary the user placed on disk themselves. The default, and the only case where in-place self-update is correct.
Implementations§
Source§impl InstallMethod
impl InstallMethod
Sourcepub fn detect(exe: &Path) -> Self
pub fn detect(exe: &Path) -> Self
Detect from an executable path, honouring INSTALL_METHOD_ENV.
Pass the resolved path — std::env::current_exe() already follows
symlinks on the platforms we ship, which is what puts a globally
npm-installed binary inside node_modules and a Homebrew one inside
Cellar rather than in the manager’s flat bin shim directory.
Sourcepub fn from_path(exe: &Path) -> Self
pub fn from_path(exe: &Path) -> Self
Path-only detection, with no environment lookup. Split out from
detect so tests can exercise the heuristics without
mutating process-global state.
Sourcepub fn update_command(self) -> &'static str
pub fn update_command(self) -> &'static str
The exact shell command that updates this install.
Homebrew’s primary formula is codewhale. Existing Cellar paths
under the legacy deepseek-tui name still detect as Homebrew; those
installs can keep using brew upgrade deepseek-tui during the
overlap window, but new notices name the Codewhale formula.
Sourcepub fn supports_self_update(self) -> bool
pub fn supports_self_update(self) -> bool
Whether codewhale update may replace this binary in place.
False for every package-managed install: see the module docs for why overwriting a managed binary is worse than doing nothing.
Trait Implementations§
Source§impl Clone for InstallMethod
impl Clone for InstallMethod
Source§fn clone(&self) -> InstallMethod
fn clone(&self) -> InstallMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more