11#! /bin/bash
22if [[ $EUID == 0 ]]; then export SUDO=" " ; else export SUDO=" sudo" ; fi
33
4- cd " $ORB_PARAM_DIR " || exit 1
4+ cd " $ORB_PARAM_DIR " || { echo " $ORB_PARAM_DIR does not exist. Exiting" ; exit 1; }
5+
6+ if [ -z " $ORB_PARAM_VERSION " ]; then
7+ echo " ORB_PARAM_VERSION is not set. Exiting."
8+ exit 1
9+ fi
510
611if uname -a | grep Darwin > /dev/null 2>&1 ; then
7- $SUDO wget -q -O chrome-for-testing.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /mac-arm64/chrome-mac-arm64.zip"
12+ $SUDO curl -s -o chrome-for-testing.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /mac-arm64/chrome-mac-arm64.zip"
813 if [ -s " chrome-for-testing.zip" ]; then
914 $SUDO unzip chrome-for-testing.zip > /dev/null 2>&1
1015 else
1116 echo " Version $ORB_PARAM_VERSION doesn't exist"
1217 exit 1
1318 fi
14- $SUDO wget -q -O chrome-for-testing-driver.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /mac-arm64/chromedriver-mac-arm64.zip"
15- $SUDO unzip chrome-for-testing-driver.zip > /dev/null 2>&1
16- $SUDO mv chromedriver-mac-arm64/chromedriver chromedriver
19+
20+ if [ " $ORB_PARAM_INSTALL_CHROMEDRIVER " = true ] ; then
21+ $SUDO curl -s -o chrome-for-testing-driver.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /mac-arm64/chromedriver-mac-arm64.zip"
22+ $SUDO unzip chrome-for-testing-driver.zip > /dev/null 2>&1
23+ $SUDO mv chromedriver-mac-arm64/chromedriver chromedriver
24+ fi
1725elif command -v apt > /dev/null 2>&1 ; then
18- $SUDO wget -q -O chrome-for-testing.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /linux64/chrome-linux64.zip"
26+ $SUDO curl -s -o chrome-for-testing.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /linux64/chrome-linux64.zip"
1927 if [ -s " chrome-for-testing.zip" ]; then
2028 $SUDO unzip chrome-for-testing.zip > /dev/null 2>&1
2129 else
@@ -27,15 +35,22 @@ elif command -v apt >/dev/null 2>&1; then
2735 $SUDO apt-get satisfy -y --no-install-recommends " ${pkg} " ;
2836 done < chrome-linux64/deb.deps;
2937
30- $SUDO wget -q -O chrome-for-testing-driver.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /linux64/chromedriver-linux64.zip"
31- $SUDO unzip chrome-for-testing-driver.zip > /dev/null 2>&1
32- $SUDO mv chromedriver-linux64/chromedriver chromedriver
38+ if [ " $ORB_PARAM_INSTALL_CHROMEDRIVER " = true ] ; then
39+ $SUDO curl -s -o chrome-for-testing-driver.zip " https://storage.googleapis.com/chrome-for-testing-public/$ORB_PARAM_VERSION /linux64/chromedriver-linux64.zip"
40+ $SUDO unzip chrome-for-testing-driver.zip > /dev/null 2>&1
41+ $SUDO mv chromedriver-linux64/chromedriver chromedriver
42+ fi
3343fi
34- $SUDO chmod +x chromedriver
3544
36- if chromedriver --version | grep " $ORB_PARAM_VERSION " > /dev/null 2>&1 ; then
37- echo " Chrome for testing installed correctly"
38- else
39- echo " Error installing Chrome for testing"
40- exit 1
45+ if [ " $ORB_PARAM_INSTALL_CHROMEDRIVER " = true ] ; then
46+ $SUDO chmod +x chromedriver
4147fi
48+
49+ if [ " $ORB_PARAM_INSTALL_CHROMEDRIVER " = true ] ; then
50+ if chromedriver --version | grep " $ORB_PARAM_VERSION " > /dev/null 2>&1 ; then
51+ echo " chromedriver for Chrome for testing installed correctly"
52+ else
53+ echo " Error installing Chrome for testing"
54+ exit 1
55+ fi
56+ fi
0 commit comments