aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaun Jackman2014-06-03 16:59:50 +0200
committerJack Nagel2014-06-12 13:11:05 -0500
commitae3e567daaf9bb021776e6064bfb0621275cc68f (patch)
treef9ba232f355a95c18b9f1897e2b5644f82fdd790
parent96195295a3462070a26e03148f5140bbf0ea4dfd (diff)
downloadbrew-ae3e567daaf9bb021776e6064bfb0621275cc68f.tar.bz2
Linuxbrew: Use xdg-open
Closes Homebrew/homebrew#29817. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-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