From bf2a1498c2018563742fe52c6ed0403e036b9e40 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Tue, 3 Jun 2014 16:59:50 +0200 Subject: Linuxbrew: Use xdg-open Closes #29817. Signed-off-by: Jack Nagel --- Library/Homebrew/os.rb | 9 +++++++++ Library/Homebrew/utils.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3