aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/os.rb9
-rw-r--r--Library/Homebrew/utils.rb2
2 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb
index e16c81c7d..918758458 100644
--- a/Library/Homebrew/os.rb
+++ b/Library/Homebrew/os.rb
@@ -6,4 +6,13 @@ module OS
def self.linux?
/linux/i === RUBY_PLATFORM
end
+
+ # Utilities
+ if OS.mac?
+ PATH_OPEN = "/usr/bin/open"
+ elsif OS.linux?
+ PATH_OPEN = "xdg-open"
+ else
+ raise "Unknown operating system"
+ end
end
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 24d028ea0..ab186eedd 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -206,7 +206,7 @@ def exec_editor *args
end
def exec_browser *args
- browser = ENV['HOMEBREW_BROWSER'] || ENV['BROWSER'] || "open"
+ browser = ENV['HOMEBREW_BROWSER'] || ENV['BROWSER'] || OS::PATH_OPEN
safe_exec(browser, *args)
end