MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / detect_install_method

Function detect_install_method

src/cloud.rs:308–322  ·  view source on GitHub ↗

Detects how tracedecay was installed by inspecting the binary path.

()

Source from the content-addressed store, hash-verified

306
307/// Detects how tracedecay was installed by inspecting the binary path.
308pub fn detect_install_method() -> InstallMethod {
309 let Ok(exe) = std::env::current_exe() else {
310 return InstallMethod::Unknown;
311 };
312 let path = exe.to_string_lossy();
313 if path.contains(".cargo/bin") || path.contains(".cargo\\bin") {
314 InstallMethod::Cargo
315 } else if path.contains("/homebrew/") || path.contains("/Cellar/") {
316 InstallMethod::Brew
317 } else if path.contains("\\scoop\\") || path.contains("/scoop/") {
318 InstallMethod::Scoop
319 } else {
320 InstallMethod::Unknown
321 }
322}
323
324/// Returns the upgrade command string.
325///

Callers 3

run_upgradeFunction · 0.85
switch_channelFunction · 0.85

Calls 1

containsMethod · 0.45

Tested by 1