Skip to content

Instantly share code, notes, and snippets.

@craSH
Created November 17, 2009 02:16
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 craSH/236563 to your computer and use it in GitHub Desktop.
Save craSH/236563 to your computer and use it in GitHub Desktop.
Simple script to automatically download and install the latest available Chromium nightly build for Mac OSX
#!/bin/bash
#
# Simple script to update OSX Chromium to the latest nightly build.
# Will not download if you already have the latest (call with --force
# to override this check)
#
# Copyleft 2010 Ian Gallagher <crash@neg9.org>
#
LATEST=$(curl -s "http://build.chromium.org/f/chromium/snapshots/Mac/LATEST")
ZIP_REMOTE="http://build.chromium.org/f/chromium/snapshots/Mac/${LATEST}/chrome-mac.zip"
ZIP_LOCAL="/tmp/chrome-mac.zip"
BIN_LOCAL="/tmp/chrome-mac/Chromium.app"
APP_DIR="/Applications/"
INSTALL_DIR="${APP_DIR}/Chromium.app"
INFO_PLIST="/Applications/Chromium.app/Contents/Info.plist"
# Grab the current SVN revision of Chromium installed on the system
installed_version=$(grep -A 1 -e SVNRevision $INFO_PLIST | tail -n1 | grep -o '[0-9]\+')
if [ $installed_version -ge $LATEST -a "--force" != "$1" ]; then
echo "Current or later version already installed"
exit 0
fi
cd /tmp/
echo "Downloading build $LATEST..."
curl -# -o $ZIP_LOCAL $ZIP_REMOTE && echo 'Download complete!'
unzip -o $ZIP_LOCAL >/dev/null && echo 'Extracted!'
rm -rf ${INSTALL_DIR} && echo "Previous version removed!"
mv $BIN_LOCAL $APP_DIR && echo 'Installed!'
rm -rf /tmp/chrome-mac
rm -f $ZIP_LOCAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment