Skip to content

Commit

Permalink
fix: dynamic CDN URL based on chrome-for-testing version (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrews authored Feb 19, 2024
1 parent 62fdb2b commit 1fcef52
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/scripts/install-chromedriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,27 @@ else
echo "New ChromeDriver version to be installed: $CHROMEDRIVER_VERSION"
fi
echo "$CHROMEDRIVER_VERSION will be installed"

if [[ $CHROMEDRIVER_VERSION -lt "121" ]]; then
CDN_BASE_URL="https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing"
else
CDN_BASE_URL="https://storage.googleapis.com/chrome-for-testing-public"
fi
if [[ $PLATFORM == "linux64" ]]; then
PLATFORM="linux64"
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROMEDRIVER_VERSION/linux64/chromedriver-linux64.zip"
"$CDN_BASE_URL/$CHROMEDRIVER_VERSION/linux64/chromedriver-linux64.zip"
elif [[ $PLATFORM == "mac64" ]]; then
PLATFORM="mac-x64"
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROMEDRIVER_VERSION/mac-x64/chromedriver-mac-x64.zip"
"$CDN_BASE_URL/$CHROMEDRIVER_VERSION/mac-x64/chromedriver-mac-x64.zip"
else
PLATFORM="win64"
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROMEDRIVER_VERSION/win64/chromedriver-win64.zip"
"$CDN_BASE_URL/$CHROMEDRIVER_VERSION/win64/chromedriver-win64.zip"
fi
fi

Expand Down

0 comments on commit 1fcef52

Please sign in to comment.