Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Update to latest Chromium build via shell script Web Browsers
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: 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.]
    •    
  • Currently 1.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[22,389 views]  

Update to latest Chromium build via shell script | 7 comments | Create New Account
Click here to return to the 'Update to latest Chromium build via shell script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Update to latest Chromium build via shell script
Authored by: Tlalox on Jun 05, '09 08:15:49AM
A bit longer, but maybe a bit more sophisticated:
#!/bin/sh
# Get current build for Chromium on Mac.
# 
# @version  2009-05-22
# @author   XXXX 
# @todo     Nothing yet

# setup ------------------------------------------------------------------------
tempDir="/tmp/`whoami`/chrome-nightly/";
baseURL="http://build.chromium.org/buildbot/snapshots/sub-rel-mac/";
baseName="chrome-mac";
baseExt="zip";
appName="Chromium.app";
appDir="/Applications";
version=~/.CURRENT_CHROME;
# ------------------------------------------------------------------------------


# ------------------------------------------------------------------------------
function checkForErrors {
    if [ "$?" != "0" ]; then
        echo "Unkown error (see above for help)!";
        exit 3;
    fi
}
# ------------------------------------------------------------------------------


# ------------------------------------------------------------------------------
echo "Setup...";
mkdir -p "$tempDir";
cd "$tempDir";
checkForErrors;
# ------------------------------------------------------------------------------


# ------------------------------------------------------------------------------
echo "Checking current version...";
touch $version
currentVersion=`cat $version`;
latestVersion=`curl -s $baseURL/LATEST`;
checkForErrors;
echo " * your/latest build: $currentVersion / $latestVersion";
if [ "$currentVersion" == "$latestVersion" ]; then
    echo " * build $currentVersion is the latest one.";
    exit 1;
fi
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
echo "Downloading and unpacking...";
chromePID=`ps wwaux|grep -v grep|grep "$appName"|awk '{print $2}'`;
if [ "$chromePID" != "" ];then
    echo " * chromium is running. Please stop it first.";
    exit 2;
fi
curl -o $baseName.$baseExt "$baseURL/$latestVersion/$baseName.$baseExt";
unzip -qo $baseName.$baseExt;
checkForErrors;
# ------------------------------------------------------------------------------


# ------------------------------------------------------------------------------
echo "Installing...";
cp -r $baseName/$appName $appDir
checkForErrors;
echo $latestVersion > $version;
# ------------------------------------------------------------------------------


# ------------------------------------------------------------------------------
echo "Done. You're now running build $latestVersion";
# ------------------------------------------------------------------------------


[ Reply to This | # ]
Update to latest Chromium build via shell script
Authored by: freecris on Jun 05, '09 08:24:27AM
Update to latest Chromium build via shell script
Authored by: cmpanas on Jun 08, '09 07:56:11PM
Boy do I need help. I created the automator action as an app with the script in it, but when I ran it I got this in the terminal:
Last login: Mon Jun 8 22:48:33 on ttys000
Setup...
Checking current version...
* your/latest build: 17731 /

404 Not Found

Not Found

The requested URL /buildbot/snapshots/sub-rel-mac//LATEST was not found on this server.

Downloading and unpacking...
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
100 1350 100 1350 0 0 20627 0 --:--:-- --:--:-- --:--:-- 659k
[chrome-mac.zip]
End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of chrome-mac.zip or chrome-mac.zip.zip, and cannot find chrome-mac.zip.ZIP, period.
Unkown error (see above for help)!

[Process completed]
I don't care that it's not working, I care that every time I open terminal now the same thing happens and I can't get out of it to a new prompt. I've rebooted and I've deleted the automator action but nothing works. Terminal is for all practical purposes fubared. Any suggestions would be much appreciated.

[ Reply to This | # ]
Update to latest Chromium build via shell script
Authored by: UberFu on Jun 08, '09 08:07:21PM
Everybody know about the Chrome [not chromium[ Dev Build Release a couple of days ago?

Google Blog Page:
http://blog.chromium.org/2009/06/danger-mac-and-linux-builds-available.html

Actual Link:
http://www.google.com/chrome/intl/en/eula_dev.html?dl=mac


[ Reply to This | # ]
Base URL Changed
Authored by: oblahdioblidaa on Jun 11, '09 04:56:17PM

Incidentally, the URL where the builds are has changed. You'll have to replace every instance of "snapshots/sub-rel-mac/" with "snapshots/chromium-rel-mac/".



[ Reply to This | # ]
Update to latest Chromium build via shell script
Authored by: Zettt on Aug 05, '11 01:54:50AM

And once more we have to change the baseURL from "chromium-rel-mac" to "Mac".



[ Reply to This | # ]
Update to latest Chromium build via shell script
Authored by: raider on Sep 13, '11 02:49:58PM
URLs have changed again.

baseURL="http://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac";

latestVersion=`curl -s $baseURL/LAST_CHANGE`;


Also, now the cURL command to get the actual file needs to use "-L" to handle redirects, as such:

curl -L "$baseURL/$latestVersion/$baseName.$baseExt" -o $baseName.$baseExt;


[ Reply to This | # ]