aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-04-25 17:53:43 +0100
committerMike McQuaid2016-05-08 16:51:22 +0100
commitddb576b582ddc801ac702566bacbc2f231fc86af (patch)
tree797a86d0cdd540a5f0b8ad3995abe43aea17f2b9 /Library/Homebrew/utils.rb
parentc5520d0050e3a5a9050314daf643b298a5432d67 (diff)
downloadbrew-ddb576b582ddc801ac702566bacbc2f231fc86af.tar.bz2
Add support for testing generic OS.
If the environment variable HOMEBREW_TEST_GENERIC_OS is set ensure that neither Mac nor Linux-specific code is loaded. This allows easier testing of cross-platform code on OS X and will make it easier to port Homebrew to platforms other than OS X and Linux.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 84bfb59b0..6502d5070 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -448,7 +448,9 @@ def exec_editor(*args)
end
def exec_browser(*args)
- browser = ENV["HOMEBREW_BROWSER"] || ENV["BROWSER"] || OS::PATH_OPEN
+ browser = ENV["HOMEBREW_BROWSER"] || ENV["BROWSER"]
+ browser ||= OS::PATH_OPEN if defined?(OS::PATH_OPEN)
+ return unless browser
safe_exec(browser, *args)
end