Skip to content

Instantly share code, notes, and snippets.

@jacob-s-son
Last active February 7, 2016 10:06
Show Gist options
  • Save jacob-s-son/2e7e9b9744a204e72bd1 to your computer and use it in GitHub Desktop.
Save jacob-s-son/2e7e9b9744a204e72bd1 to your computer and use it in GitHub Desktop.
chromedriver.sh
#!/bin/bash
# Install a newer version of Chromedriver, https://sites.google.com/a/chromium.org/chromedriver/
#
# Include in your builds via
# \curl -sSL https://gist.githubusercontent.com/jacob-s-son/2e7e9b9744a204e72bd1/raw/92c46fbed6bfc32e7b15c660b53d2a33c277fe0e/chromedriver.sh | | bash -s
LATEST=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
CHROME_DRIVER_URL="https://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip"
CACHED_DOWNLOAD="${HOME}/cache/chromedriver.zip"
CACHED_EXECUTABLE="${HOME}/cache/chromedriver"
# exit on the first error
set -e
# download and symlink latest version
wget --continue --output-document "${CACHED_DOWNLOAD}" "${CHROME_DRIVER_URL}"
unzip -u "${CACHED_DOWNLOAD}" -d "${HOME}/cache"
chmod u+x "${CACHED_EXECUTABLE}"
ln -sf "${CACHED_EXECUTABLE}" "${HOME}/bin/chromedriver"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment