Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sampowers/215dabcd30d2e400b1823ed1eecc476e to your computer and use it in GitHub Desktop.
Save sampowers/215dabcd30d2e400b1823ed1eecc476e to your computer and use it in GitHub Desktop.
#!/bin/bash
# Downloads the latest chromedriver url, re-using the data provided by the maven webdriver installer plugin. Depends on jq but not maven.
function chromedriver_linux_64_latest_url () {
curl -s https://raw.githubusercontent.com/webdriverextensions/webdriverextensions-maven-plugin-repository/master/repository-3.0.json \
| jq -r '
[.drivers[]
| select(.name == "chromedriver")
| select(.platform == "linux")
| select(.bit == "64")
][0].url'
}
echo "Fetching latest chromedriver binary"
curl --progress-bar -Lo /tmp/chromedriver $(chromedriver_linux_64_latest_url)
mv /tmp/chromedriver /usr/local/bin/chromedriver
chmod +x /usr/local/bin/chromedriver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment