Update to latest Chromium build via shell script

Jun 05, '09 07:30:00AM

Contributed by: oblahdioblidaa

If you want to stay on the bleeding edge of Chromium for OS X's development, the following shell script automatically downloads the latest build of Chromium for Mac. Open Terminal and create a new file with vi, emacs, nano, etc. Paste in the following code:

#!/bin/bash
mkdir /tmp/chromedownload && cd /tmp/chromedownload
curl http://build.chromium.org/buildbot/snapshots/sub-rel-mac/LATEST -o /tmp/chromedownload/LATEST --silent && LATEST=`cat /tmp/chromedownload/LATEST`
curl http://build.chromium.org/buildbot/snapshots/sub-rel-mac/$LATEST/chrome-mac.zip -o /tmp/chromedownload/chrome-mac.zip --silent
unzip -qq /tmp/chromedownload/chrome-mac.zip
cp -R /tmp/chromedownload/chrome-mac/Chromium.app /Applications
rm -rf /tmp/chromedownload
Save this script somewhere, make it executable (chmod a+x /path/to/script.sh), and schedule it with cron.

[robg adds: I tested this one, and it works as described. If you're interested in Chromium, I recently wrote a Chromium first look article for Macworld. Of course, there have been about 100 new builds since then, so things are moving quickly.

I also took the above script and wrapped it in an Automator action, along with a simple AppleScript (below) to quit Chromium if it's running -- I don't update often enough that I want to cron the task, but I wanted to make updating a simple one-click process. So I saved my workflow as an application, and put it on the Finder's toolbar. Here's the AppleScript I embedded in the workflow:
on run {input, parameters}
  tell application "System Events"
    if exists (some process whose name contains "Chromium") then
      tell application "Chromium" to quit
    end if
  end tell
end run
I prettied it up a bit with a dialog to let me know when it was done, and it works well. Updates are now a click away, and I don't have to remember to quit Chromium first.]

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20090604081030791