diff options
| author | Shaun Jackman | 2014-06-03 16:59:50 +0200 |
|---|---|---|
| committer | Jack Nagel | 2014-06-12 13:11:05 -0500 |
| commit | bf2a1498c2018563742fe52c6ed0403e036b9e40 (patch) | |
| tree | 777fb0aac1883b41976da9bb792367f0af81d6cd | |
| parent | cc621d965c15bebfabcd8d0cf5bb8e19405db28f (diff) | |
| download | homebrew-bf2a1498c2018563742fe52c6ed0403e036b9e40.tar.bz2 | |
Linuxbrew: Use xdg-open
Closes #29817.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
| -rw-r--r-- | Library/Homebrew/os.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 2 |
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 |
