Linuxbrew: Use xdg-open

Closes Homebrew/homebrew#29817.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Shaun Jackman 2014-06-03 16:59:50 +02:00 committed by Jack Nagel
parent 96195295a3
commit ae3e567daa
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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