install: fix prefix checks.

Co-authored-by: Bo Anderson <mail@boanderson.me>
This commit is contained in:
Mike McQuaid 2020-11-12 18:58:03 +00:00 committed by GitHub
parent 5afff3f3aa
commit c91ff3c399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,9 +30,9 @@ module Homebrew
end
def check_prefix
if Hardware::CPU.intel? && HOMEBREW_PREFIX == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
if Hardware::CPU.intel? && HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
odie "Cannot install in Homebrew on Intel processor in ARM default prefix (#{HOMEBREW_PREFIX})!"
elsif Hardware::CPU.arm? && HOMEBREW_PREFIX == HOMEBREW_DEFAULT_PREFIX
elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX
odie "Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})!"
end
end