Name: Anonymous 2011-01-12 19:15
What do you think?
#!/bin/bash
### chromium_updater.sh - Version 1.3.1
# downloads, unpacks and installs the latest chromium nightly build for os x
# http://build.chromium.org/f/chromium/snapshots/chromium-rel-mac/LATEST
# http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST
# please change this variable to your prefered install location (default is /Applications)!
APPDIR="/Applications"
LATEST=$(curl -s http://build.chromium.org/f/chromium/snapshots/chromium-rel-mac/LATEST)
if [ "${?}" -gt "0" ]; then
echo "I can't find the latest build!"
exit 1
elif [ ! -e ${APPDIR}/Chromium.app ]; then
echo "I couldn't find Chromium in \"${APPDIR}\", performing initial install of Build ${LATEST}."
else
LAST=$(/usr/libexec/PlistBuddy -c "Print SVNRevision" ${APPDIR}/Chromium.app/Contents/Info.plist 2>/dev/null)
if [ ${LATEST} -eq ${LAST} ]; then
echo "Chromium is already up to date!"
exit 1
fi
echo "Updating from Build ${LAST} to ${LATEST}"
fi
trap "rm -rf ${TMPDIR}/chrome-mac.zip 2>/dev/null; rm -rf ${TMPDIR}/chrome-mac 2>/dev/null; exit 1" 1 2 15
curl -# http://build.chromium.org/f/chromium/snapshots/chromium-rel-mac/$;{LATEST}/chrome-mac.zip -o ${TMPDIR}/chrome-mac.zip
unzip -oqq ${TMPDIR}/chrome-mac.zip -d ${TMPDIR}/
rm ${TMPDIR}/chrome-mac.zip
killall Chromium 2>/dev/null
DERP=${?}
sleep 2
mv ${APPDIR}/Chromium.app ${HOME}/.Trash/Chromium_${LAST}.app 2>/dev/null
mv ${TMPDIR}/chrome-mac/Chromium.app ${APPDIR}
if [ "${DERP}" -eq "0" ] || [ "${1}" = "-o" ]; then
open -g ${APPDIR}/Chromium.app
fi
exit 0