mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
DEV: check for google-chrome-stable first
on my distro google-chrome-stable is the only binary created when installing chrome, this ensures we check for it first
This commit is contained in:
parent
64f20e7e7a
commit
21c4754324
|
@ -114,9 +114,13 @@ module Autospec
|
||||||
private
|
private
|
||||||
|
|
||||||
def ensure_chrome_is_installed
|
def ensure_chrome_is_installed
|
||||||
raise ChromeNotInstalled.new unless system("command -v google-chrome >/dev/null;")
|
|
||||||
|
|
||||||
if Gem::Version.new(`$(command -v google-chrome) --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59")
|
binary = "google-chrome-stable" if system("command -v google-chrome-stable >/dev/null;")
|
||||||
|
binary ||= "google-chrome" if system("command -v google-chrome >/dev/null;")
|
||||||
|
|
||||||
|
raise ChromeNotInstalled.new if !binary
|
||||||
|
|
||||||
|
if Gem::Version.new(`#{binary} --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59")
|
||||||
raise "Chrome 59 or higher is required"
|
raise "Chrome 59 or higher is required"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user