Created
November 17, 2009 02:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 <[email protected]> | |
# | |
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