Skip to content

Instantly share code, notes, and snippets.

@rghose
Created December 5, 2016 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rghose/106ae71639c6f9ce9076a260a5614b94 to your computer and use it in GitHub Desktop.
Save rghose/106ae71639c6f9ce9076a260a5614b94 to your computer and use it in GitHub Desktop.
#!/bin/bash
website="http://chromedriver.storage.googleapis.com"
version=$(curl "$website/LATEST_RELEASE")
os_name="unknown"
if [ "$(uname)" == "Darwin" ]; then
os_name="mac64";
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
os_name="linux32";
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
os_name="win32"
fi
if [ "X"$os_name == "X" ]; then
echo "Could not detect operating system."
return
fi
if [ ! -e "chromedriver_$os_name_$version.zip" ]; then
curl "$website/$version/chromedriver_$os_name.zip" -o "chromedriver_$os_name_$version.zip"
else
echo "Found latest verion in current directory..."
fi
mkdir $HOME/bin
unzip chromedriver_$os_name_$version.zip -d $HOME/bin
echo "PATH=$PATH:$HOME/bin" >> $HOME/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment