From cd5f054ab6e132d2d941580882c23605de915954 Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 16 Jul 2020 15:57:38 +0200 Subject: [PATCH] =?UTF-8?q?target=20github=20direct=20download=20link=20fo?= =?UTF-8?q?r=20geckodriver,=20operadriver,=20sele=E2=80=A6=20(#259)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit target github direct download link for geckodriver, operadriver, selenoid, and preserv backward compatibility of the use of 'latest' wildcard --- selenium/build.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/selenium/build.sh b/selenium/build.sh index afc91dc9e..660d1bcb4 100755 --- a/selenium/build.sh +++ b/selenium/build.sh @@ -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 @@ -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 @@ -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 }