committed by
GitHub
parent
e38fc78c3b
commit
098b60ba38
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user