From c7b85830120465bb20d541d1e2cc750e23edf303 Mon Sep 17 00:00:00 2001 From: Zach Berger Date: Mon, 30 Nov 2020 09:00:21 -0800 Subject: [PATCH] Check architecture for default value of brew path in all cases. --- Brewlet/AppDelegate.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Brewlet/AppDelegate.swift b/Brewlet/AppDelegate.swift index ec03d61..ef526b4 100644 --- a/Brewlet/AppDelegate.swift +++ b/Brewlet/AppDelegate.swift @@ -496,8 +496,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, PreferencesDelegate { func run_command(arguments: [String], fileRedirect: FileHandle? = nil, outputHandler: @escaping (Process,Data) -> Void) { - - let brewPath = self.userDefaults.string(forKey: "brewPath") ?? "/usr/local/bin/brew" + #if arch(arm64) + let brewPath = userDefaults.string(forKey: "brewPath") ?? PreferencesController.HomebrewPath.appleSilicon.rawValue + #elseif arch(x86_64) + let brewPath = userDefaults.string(forKey: "brewPath") ?? PreferencesController.HomebrewPath.intel.rawValue + #endif let task = Process() task.launchPath = "/bin/bash" task.arguments = [brewPath] + arguments