Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (28 sloc) 1.552 kb
#!/bin/bash
set -o nounset
set -o errexit
TMP_DIR=/tmp/chromiumdownload
APP_DIR=/Applications
BASE_URL=http://commondatastorage.googleapis.com/chromium-browser-continuous/Mac
LATEST_VER=$(curl -sS $BASE_URL/LAST_CHANGE)
# Either of these could change at any moment.
FILE_NAME=chrome-mac.zip
APP_NAME=Chromium.app
# check current revision number
CURRENT_VER=$(/usr/libexec/PlistBuddy -c "print SVNRevision" $APP_DIR/$APP_NAME/Contents/Info.plist) || CURRENT_VER=0
CHANGELOG="http://build.chromium.org/buildbot/perf/dashboard/ui/changelog.html?url=/trunk/src&range=$LATEST_VER:$CURRENT_VER&mode=html"
echo $CHANGELOG | pbcopy
# bail if there is not a newer version
echo "Latest is $LATEST_VER. You have $CURRENT_VER."
echo "Changelog (in clipboard): $CHANGELOG"
[[ $LATEST_VER > $CURRENT_VER ]] && echo "Downloading." || { echo "Quitting."; exit 1; }
mkdir -p $TMP_DIR && cd $TMP_DIR
curl -L -O $BASE_URL/$LATEST_VER/$FILE_NAME
# I really wish they would create tar/gz files instead of zip files so that I could pipe curl to tar and not write the archive to disk.
unzip -qq $FILE_NAME
# Because this script rename the existing app with its version and moves it to the temp dir, it is safe to run while the app open.`
APP_NAME=$(basename ${FILE_NAME%%.zip}/*.app)
[[ -d $APP_DIR/$APP_NAME ]] && mv $APP_DIR/$APP_NAME ./${APP_NAME%%.app}.$CURRENT_VER.app
mv ${FILE_NAME%%.zip}/$APP_NAME $APP_DIR/$APP_NAME
# Calling this script with the -o flag launched the browser when everything is done (Mac only so far)
[[ $1 == '-o' ]] && open $APP_DIR/$APP_NAME
Jump to Line
Something went wrong with that request. Please try again.