Skip to content

Instantly share code, notes, and snippets.

@SlexAxton
Last active December 15, 2015 02:49
Show Gist options
  • Save SlexAxton/5190467 to your computer and use it in GitHub Desktop.
Save SlexAxton/5190467 to your computer and use it in GitHub Desktop.
add this function to your .zshrc or .bashrc file to update chromium to the latest nightly with a command.
updatechromium () {
Platform='unknown'
platform='unknown'
unamestr=`uname`
case "$unamestr" in
('Darwin') Platform="Mac"
platform="mac" ;;
('Linux') Platform="Linux"
platform="linux" ;;
(*) if [[ $# = 2 ]]
then
Platform=$(echo "$2" | sed -e "s/\([^\.]\+\)/\u\1/g")
platform=$(echo "$2" | tr '[A-Z]' '[a-z]')
elif [[ $# = 1 ]]
then
Platform=$(echo "$1" | sed -e "s/\([^\.]\+\)/\u\1/g")
platform=$(echo "$1" | tr '[A-Z]' '[a-z]')
fi ;;
esac
echo "$unamestr :: $Platform : $platform"
echo
BASEDIR=http://commondatastorage.googleapis.com/chromium-browser-continuous/$Platform
cd ~/$1
echo "Downloading number of latest revision"
REVNUM=`curl -# $BASEDIR/LAST_CHANGE`
echo "Found latest revision number $REVNUM, starting download"
curl $BASEDIR/$REVNUM/chrome-$platform.zip > $REVNUM.zip
echo "Unzipping..."
unzip $REVNUM.zip 2>&1 > /dev/null
echo "Done."
rm -rf /Applications/Chromium.app
mv chrome-mac/Chromium.app /Applications/Chromium.app
rm -rf chrome-mac
rm -rf $REVNUM.zip
echo "Moving to Applications directory..."
echo "Done, update successful"
}
@SlexAxton
Copy link
Author

Add that to your bashrc or zshrc and then just call the function

> updatechromium

@SlexAxton
Copy link
Author

(Note: I can't remember where I stole the parts of this from, but I'm just pasting it here cause some peeps asked for it. I had to update some URLs and paths to make it work for me. So apologies if you wrote it. Claim it here!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment