diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 99c6fef7..f8122832 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -16,6 +16,8 @@ use std::path::PathBuf; use std::process::Command; use std::{env, path::Path}; +const INTEL_BREW: &str = "/usr/local/bin/brew"; +const ARM_BREW: &str = "/opt/homebrew/bin/brew"; #[derive(Copy, Clone, Debug)] #[allow(dead_code)] pub enum BrewVariant { @@ -27,14 +29,14 @@ pub enum BrewVariant { impl BrewVariant { fn binary_name(self) -> &'static str { match self { - BrewVariant::Linux => "/home/linuxbrew/.linuxbrew/bin/brew", - BrewVariant::MacIntel => "/usr/local/bin/brew", - BrewVariant::MacArm => "/opt/homebrew/bin/brew", + BrewVariant::Linux => "brew", + BrewVariant::MacIntel => INTEL_BREW, + BrewVariant::MacArm => ARM_BREW, } } fn both_both_exist() -> bool { - Path::new("/usr/local/bin/brew").exists() && Path::new("/opt/homebrew/bin/brew").exists() + Path::new(INTEL_BREW).exists() && Path::new(ARM_BREW).exists() } pub fn step_title(self) -> &'static str {