Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
target github direct download link for geckodriver, operadriver, sele… (
Browse files Browse the repository at this point in the history
#259)

target github direct download link for geckodriver, operadriver, selenoid, and preserv backward compatibility of the use of 'latest' wildcard
  • Loading branch information
M4nouel authored Jul 16, 2020
1 parent 1021474 commit cd5f054
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions selenium/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ download_selenium() {
}

download_geckodriver() {
local tag=""
local download_url=""
if [ "$1" == "latest" ]; then
tag="$1"
download_url=$(wget -qO- "https://api.github.com/repos/mozilla/geckodriver/releases/$1" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
else
tag="tags/v$1"
download_url="https://github.com/mozilla/geckodriver/releases/download/v$1/geckodriver-v$1-linux64.tar.gz"
fi
local download_url=$(wget -qO- "https://api.github.com/repos/mozilla/geckodriver/releases/$tag" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
wget -O geckodriver.tar.gz "$download_url"
tar xvzf geckodriver.tar.gz
rm -Rf geckodriver.tar.gz
Expand All @@ -51,13 +50,12 @@ download_chromedriver() {
}

download_operadriver() {
local tag=""
local download_url=""
if [ "$1" == "latest" ]; then
tag="$1"
download_url=$(wget -qO- "https://api.github.com/repos/operasoftware/operachromiumdriver/releases/$1" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
else
tag="tags/v.$1"
download_url="https://github.com/operasoftware/operachromiumdriver/releases/download/v.$1/operadriver_linux64.zip"
fi
local download_url=$(wget -qO- "https://api.github.com/repos/operasoftware/operachromiumdriver/releases/$tag" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
wget -O operadriver.zip "$download_url"
unzip operadriver.zip
if [ -d operadriver_linux64 ]; then
Expand Down Expand Up @@ -85,13 +83,12 @@ download_yandexdriver() {
}

download_selenoid() {
local tag=""
local download_url=""
if [ "$1" == "latest" ]; then
tag="$1"
download_url=$(wget -qO- "https://api.github.com/repos/aerokube/selenoid/releases/$1" | jq -r '.assets[].browser_download_url | select(contains("linux_amd64"))')
else
tag="tags/$1"
download_url="https://github.com/aerokube/selenoid/releases/download/$1/selenoid_linux_amd64"
fi
local download_url=$(wget -qO- "https://api.github.com/repos/aerokube/selenoid/releases/$tag" | jq -r '.assets[].browser_download_url | select(contains("linux_amd64"))')
wget -O selenoid "$download_url"
chmod +x selenoid
}
Expand Down

0 comments on commit cd5f054

Please sign in to comment.