Skip to content

Commit

Permalink
Try other names for chrome executable on linux (#1786)
Browse files Browse the repository at this point in the history
* Try other names for chrome executable on linux

Not all distributions use `google-chrome-stable`, Archlinux for example packages `chromium`, which is basically chrome without branding. So let's try other names too so it works out-of-the-box on more systems.
  • Loading branch information
graywolf authored and iliabylich committed Mar 19, 2018
1 parent adceec4 commit c0fe2ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/opal/cli_runners/chrome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ def chrome_executable
when /darwin|mac os/
'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
when /linux/
'google-chrome-stable'
%w[
google-chrome-stable
chromium
].each do |name|
next unless system('sh', '-c', "command -v #{name.shellescape}", out: '/dev/null')
return name
end
raise 'Cannot find chrome executable'
when /solaris|bsd/
raise 'Headless chrome is supported only by Mac OS and Linux'
end
Expand Down

0 comments on commit c0fe2ca

Please sign in to comment.