Shaun Jackman 73ba9b3d88 Define OS::Mac on Linux
Define MacOS.version, MacOS.full_version, and MacOS::Xcode.version to
Version::NULL on Linux so that brew readall succeeds and Homebrew/brew
can tap Homebrew/core on Linux.
2018-02-20 11:22:40 -08:00

29 lines
776 B
Ruby

require "rbconfig"
module OS
def self.mac?
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
RbConfig::CONFIG["host_os"].include? "darwin"
end
def self.linux?
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
RbConfig::CONFIG["host_os"].include? "linux"
end
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
if OS.mac?
require "os/mac"
# Don't tell people to report issues on unsupported versions of macOS.
if !OS::Mac.prerelease? && !OS::Mac.outdated_release?
ISSUES_URL = "https://docs.brew.sh/Troubleshooting.html".freeze
end
PATH_OPEN = "/usr/bin/open".freeze
elsif OS.linux?
require "os/linux"
ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze
PATH_OPEN = "xdg-open".freeze
end
end