Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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