2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-10-18 12:56:51 -05:00
|
|
|
module OS
|
|
|
|
def self.mac?
|
2016-07-26 20:30:30 -06:00
|
|
|
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
2018-09-17 02:45:00 +02:00
|
|
|
|
2017-07-26 22:26:29 +02:00
|
|
|
RbConfig::CONFIG["host_os"].include? "darwin"
|
2013-10-18 12:56:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.linux?
|
2016-07-27 22:10:34 -06:00
|
|
|
return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
2018-09-17 02:45:00 +02:00
|
|
|
|
2017-07-26 22:26:29 +02:00
|
|
|
RbConfig::CONFIG["host_os"].include? "linux"
|
2013-10-18 12:56:51 -05:00
|
|
|
end
|
2014-06-03 16:59:50 +02:00
|
|
|
|
2016-04-04 11:46:33 +01:00
|
|
|
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
|
|
|
|
|
2014-06-03 16:59:50 +02:00
|
|
|
if OS.mac?
|
2015-10-16 16:41:14 +08:00
|
|
|
require "os/mac"
|
2019-01-21 12:39:08 +00:00
|
|
|
# Don't tell people to report issues on unsupported configurations.
|
|
|
|
if !OS::Mac.prerelease? &&
|
|
|
|
!OS::Mac.outdated_release? &&
|
|
|
|
ARGV.none? { |v| v.start_with?("--cc=") } &&
|
|
|
|
ENV["HOMEBREW_PREFIX"] == "/usr/local"
|
2019-04-19 15:38:03 +09:00
|
|
|
ISSUES_URL = "https://docs.brew.sh/Troubleshooting"
|
2016-11-05 10:58:19 -04:00
|
|
|
end
|
2019-04-19 15:38:03 +09:00
|
|
|
PATH_OPEN = "/usr/bin/open"
|
2014-06-03 16:59:50 +02:00
|
|
|
elsif OS.linux?
|
2018-02-20 11:13:13 -08:00
|
|
|
require "os/linux"
|
2019-04-19 15:38:03 +09:00
|
|
|
ISSUES_URL = "https://docs.brew.sh/Troubleshooting"
|
|
|
|
PATH_OPEN = "xdg-open"
|
2014-06-03 16:59:50 +02:00
|
|
|
end
|
2013-10-18 12:56:51 -05:00
|
|
|
end
|