Path: blob/trunk/scripts/github-actions/delete-browsers-drivers.sh
11810 views
#!/usr/bin/env bash1#2# Delete pre-installed browsers and WebDriver binaries so browser tests resolve3# the bazel-pinned / Selenium-Manager-downloaded versions instead of the system4# copies. Runs on Linux and macOS.56set -u78echo "Removing pre-installed drivers and browsers"910# Drivers: the runner exposes their locations via env vars on Linux and macOS.11# `--` guards against any env value that begins with a dash.12sudo rm -rf -- "${CHROMEWEBDRIVER:-}" "${EDGEWEBDRIVER:-}" "${GECKOWEBDRIVER:-}"1314# Browsers: no env var points at these, so the paths are OS-specific.15if [ "${RUNNER_OS:-}" = "macOS" ]; then16sudo rm -rf -- "/Applications/Google Chrome.app" \17"/Applications/Firefox.app" \18"/Applications/Microsoft Edge.app"19else20sudo rm -rf -- /opt/google/chrome /opt/firefox /opt/microsoft/msedge21fi222324