Skip to content

Commit

Permalink
add macOS brew arch check for doctor
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywhalecc committed Apr 12, 2024
1 parent e3c542d commit 8475357
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SPC/doctor/item/MacOSToolCheckList.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ class MacOSToolCheckList
#[AsCheckItem('if homebrew has installed', limit_os: 'Darwin', level: 998)]
public function checkBrew(): ?CheckResult
{
// 检查 homebrew 是否已经安装
if ($this->findCommand('brew') === null) {
if (($path = $this->findCommand('brew')) === null) {
return CheckResult::fail('Homebrew is not installed', 'brew');
}
if ($path !== '/opt/homebrew/bin/brew' && php_uname('m') === 'arm64') {
return CheckResult::fail('Current homebrew (/usr/local/bin/homebrew) is not installed for M1 Mac, please re-install homebrew in /opt/homebrew/ !');
}
return CheckResult::ok();
}

Expand Down

0 comments on commit 8475357

Please sign in to comment.