Skip to content

Instantly share code, notes, and snippets.

@SlexAxton
Created December 11, 2013 00:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SlexAxton/7903121 to your computer and use it in GitHub Desktop.
Save SlexAxton/7903121 to your computer and use it in GitHub Desktop.
Run this to update chromium to the latest nightly on os x
updatechromium () {
mkdir -p /Applications/Browsers
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/Browsers/Chromium.app
mv chrome-mac/Chromium.app /Applications/Browsers/Chromium.app
rm -rf chrome-mac
rm -rf $REVNUM.zip
echo "Moving to Applications directory..."
echo "Done, update successful"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment