File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Install the latest version of geckodriver
4+ version=$( curl -sI https://github.com/mozilla/geckodriver/releases/latest | grep -i " ^Location: " | sed ' s/.*\///' | tr -d ' \r' )
5+
6+ # check that we got something
7+ if [ -z " $version " ]; then
8+ echo " Failed to determine the latest geckodriver version!"
9+ exit 1
10+ fi
11+
12+ # Geckodriver distribution is MacOS or Linux specific
13+ os=" $( uname -s) "
14+ if [[ $os == " Darwin" ]]; then
15+ os_dist=" macos.tar.gz"
16+ else
17+ os_dist=" linux64.tar.gz"
18+ fi
19+
20+ echo " Setting up geckodriver version $version ..."
21+ url=" https://github.com/mozilla/geckodriver/releases/download/${version} /geckodriver-${version} -${os_dist} "
22+ wget -q -O /tmp/geckodriver.tar.gz " $url "
23+ sudo tar -xvf /tmp/geckodriver.tar.gz -C /usr/local/bin/
24+ sudo chmod a+x /usr/local/bin/geckodriver
25+
26+ # check that geckodriver is now present
27+ type geckodriver > /dev/null 2>&1 || {
28+ echo " Failed to install geckodriver!"
29+ exit 1
30+ }
You can’t perform that action at this time.
0 commit comments