aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-01-20 09:00:53 +0100
committerMarkus Reiter2017-01-24 23:43:56 +0100
commitd94636cde921288aa7a33a0f368a3101fd8f3df3 (patch)
tree3a8ced0733ff21c6f37387deaed575f881b07e0d /Library
parent35045b2934d94eabe302693a05b12fb530827454 (diff)
downloadbrew-d94636cde921288aa7a33a0f368a3101fd8f3df3.tar.bz2
Allow overriding MacOS.version.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli.rb4
-rw-r--r--Library/Homebrew/os/mac.rb5
2 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb
index 36fae3034..2b2211877 100644
--- a/Library/Homebrew/cask/lib/hbc/cli.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli.rb
@@ -142,6 +142,10 @@ module Hbc
end
def self.process(arguments)
+ unless ENV["MACOS_VERSION"].nil?
+ MacOS.full_version = ENV["MACOS_VERSION"]
+ end
+
command_string, *rest = *arguments
rest = process_options(rest)
command = Hbc.help ? "help" : lookup_command(command_string)
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index 9468a6c1e..e09a9b3fd 100644
--- a/Library/Homebrew/os/mac.rb
+++ b/Library/Homebrew/os/mac.rb
@@ -27,6 +27,11 @@ module OS
@full_version ||= Version.new((ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_OSX_VERSION"]).chomp)
end
+ def full_version=(version)
+ @full_version = Version.new(version.chomp)
+ @version = nil
+ end
+
def prerelease?
# TODO: bump version when new OS is released
version >= "10.13"