Skip to content

Commit

Permalink
Check architecture for default value of brew path in all cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachberger committed Nov 30, 2020
1 parent 27492fc commit c7b8583
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Brewlet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c7b8583

Please sign in to comment.