Skip to content

Commit

Permalink
GOOGLE_CHROME_SHIM now responds to --version and --product-version. (h…
Browse files Browse the repository at this point in the history
…eroku#73)

This change adds out-of-the-box compatibility with the webdrivers gem, which apparently quite a few Heroku users are using. Currently, the users have to use a workaround in their project to get the Chrome version from $GOOGLE_CHROME_BIN, so that webdrivers can download the appropriate version of chromedriver, and then switch back to $GOOGLE_CHROME_SHIM to launch Chrome.

See titusfortner/webdrivers#40, titusfortner/webdrivers#72, and titusfortner/webdrivers#134.

This simple change will provide the convenience of not needing any hacks to make the two work :).
  • Loading branch information
kapoorlakshya authored and jabrown85 committed Jun 21, 2019
1 parent 737a426 commit f77e60c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ BIN_DIR=$BUILD_DIR/.apt/usr/bin
rm $BIN_DIR/$SHIM
cat <<EOF >$BIN_DIR/$SHIM
#!/usr/bin/env bash
exec \$HOME/.apt/opt/google/$BIN --headless --no-sandbox --disable-gpu --remote-debugging-port=9222 \$@
if [ $1 = "--version" ]; then
exec \$HOME/.apt/opt/google/$BIN --version
elif [ $1 = "--product-version" ]; then
exec \$HOME/.apt/opt/google/$BIN --product-version
else
exec \$HOME/.apt/opt/google/$BIN --headless --no-sandbox --disable-gpu --remote-debugging-port=9222 \$@
fi
EOF
chmod +x $BIN_DIR/$SHIM
cp $BIN_DIR/$SHIM $BIN_DIR/google-chrome
Expand Down

0 comments on commit f77e60c

Please sign in to comment.