mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

The existing one has two issues: * It doesn't reflect Linuxbrew's move to a separate GitHub org * It redirects to the legacy-linuxbrew (pre-core/brew split) wiki
26 lines
714 B
Ruby
26 lines
714 B
Ruby
module OS
|
|
def self.mac?
|
|
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
|
RUBY_PLATFORM.to_s.downcase.include? "darwin"
|
|
end
|
|
|
|
def self.linux?
|
|
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
|
RUBY_PLATFORM.to_s.downcase.include? "linux"
|
|
end
|
|
|
|
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
|
|
|
|
if OS.mac?
|
|
require "os/mac"
|
|
ISSUES_URL = "https://git.io/brew-troubleshooting".freeze
|
|
PATH_OPEN = "/usr/bin/open".freeze
|
|
# compatibility
|
|
::MACOS_FULL_VERSION = OS::Mac.full_version.to_s.freeze
|
|
::MACOS_VERSION = OS::Mac.version.to_s.freeze
|
|
elsif OS.linux?
|
|
ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze
|
|
PATH_OPEN = "xdg-open".freeze
|
|
end
|
|
end
|