From f77e60ca35a163a2fa5a97f4f877d4a9af24fd2d Mon Sep 17 00:00:00 2001 From: Lakshya Kapoor Date: Fri, 21 Jun 2019 07:28:13 -0700 Subject: [PATCH] GOOGLE_CHROME_SHIM now responds to --version and --product-version. (#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 :). --- bin/compile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 9bebb6b..97ca86a 100755 --- a/bin/compile +++ b/bin/compile @@ -171,7 +171,13 @@ BIN_DIR=$BUILD_DIR/.apt/usr/bin rm $BIN_DIR/$SHIM cat <$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