-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add updatePantherChromeDriver.sh to have corresponding chrome driver …
…in travis ci available
- Loading branch information
1 parent
630ccba
commit f4057bb
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
# ensure that symfony/panther's chromeDriver matches installed chromium version | ||
# this needs chromium and symfony/panther (in vendor folder) to be installed | ||
|
||
cd vendor/symfony/panther/chromedriver-bin | ||
|
||
chromiumVersion=$(chromium --product-version 2>&1;); | ||
googleChromeVersion=$(google-chrome --product-version 2>&1;); | ||
if [[ ${chromiumVersion} == *"."*"."* ]]; then | ||
chromiumVersion="$( cut -d '.' -f 1 <<< "$chromiumVersion" )"; | ||
echo "Found chromiumVersion ${chromiumVersion}"; | ||
chromeDriverVersion="_${chromiumVersion}" | ||
elif [[ ${googleChromeVersion} == *"."*"."* ]]; then | ||
googleChromeVersion="$( cut -d '.' -f 1 <<< "$googleChromeVersion" )"; | ||
echo "Found googleChromeVersion ${googleChromeVersion}"; | ||
chromeDriverVersion="_${googleChromeVersion}" | ||
else | ||
"No google-chrome or chromium found. Using latest release..." | ||
chromeDriverVersion="" | ||
fi | ||
|
||
chromeDriver=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE${chromeDriverVersion}); | ||
echo "Downloading ChromeDriver version ${chromeDriver} from https://chromedriver.storage.googleapis.com/LATEST_RELEASE${chromeDriverVersion} ..." | ||
|
||
declare -a binaries=("chromedriver_linux64" "chromedriver_mac64" "chromedriver_win32") | ||
for name in "${binaries[@]}" | ||
do | ||
curl -s https://chromedriver.storage.googleapis.com/${chromeDriver}/${name}.zip -O | ||
unzip -q -o ${name}.zip | ||
rm ${name}.zip | ||
if [[ -f "chromedriver" ]]; then | ||
mv chromedriver ${name} | ||
fi | ||
done | ||
|
||
curl -s https://chromedriver.storage.googleapis.com/${chromeDriver}/notes.txt -O | ||
echo "Done." | ||
|