Skip to content

Commit

Permalink
Improve update panther chrome driver script by supporting chromium-br…
Browse files Browse the repository at this point in the history
…owser executable

which will be used after e.g. "apk add chromium"
  • Loading branch information
robertfausk committed Oct 7, 2020
1 parent a05c49d commit 20c112c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/updatePantherChromeDriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
cd vendor/symfony/panther/chromedriver-bin

chromiumVersion=$(chromium --product-version 2>&1;);
chromiumBrowserVersion=$(chromium-browser --product-version 2>&1;);
googleChromeVersion=$(google-chrome --product-version 2>&1;);
if [[ ${chromiumVersion} == *"."*"."* ]]; then
chromiumVersion="$( cut -d '.' -f 1 <<< "$chromiumVersion" )";
echo "Found chromiumVersion ${chromiumVersion}";
echo "Found chromium version ${chromiumVersion}";
chromeDriverVersion="_${chromiumVersion}"
elif [[ ${chromiumBrowserVersion} == *"."*"."* ]]; then
chromiumBrowserVersion="$( cut -d '.' -f 1 <<< "$chromiumBrowserVersion" )";
echo "Found chromium-browser version ${chromiumBrowserVersion}";
chromeDriverVersion="_${chromiumBrowserVersion}"
elif [[ ${googleChromeVersion} == *"."*"."* ]]; then
googleChromeVersion="$( cut -d '.' -f 1 <<< "$googleChromeVersion" )";
echo "Found googleChromeVersion ${googleChromeVersion}";
echo "Found google-chrome version ${googleChromeVersion}";
chromeDriverVersion="_${googleChromeVersion}"
else
"No google-chrome or chromium found. Using latest release..."
"No google-chrome, chromium-browser or chromium found. Using latest release..."
chromeDriverVersion=""
fi

Expand All @@ -35,4 +40,3 @@ done

curl -s https://chromedriver.storage.googleapis.com/${chromeDriver}/notes.txt -O
echo "Done."

0 comments on commit 20c112c

Please sign in to comment.