Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jman240

macrumors 6502a
Original poster
May 26, 2009
807
253
Dunno if this is the right place to put this but I thought it may be useful to someone.

This script (save as .sh file and make it executable via 'chmod +x script.sh' command) downloads the latest chrome file, installs it (ignore the errors) and then deletes the install copy. It works for me, if you have extra time you can probably convert it to an automator action or something of the like.

tested on 10.6.1 snow leopard

Code:
#!/bin/bash
mkdir ~/Desktop/chromedownload
cd ~/Desktop/chromedownload 
curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST -o ~/Desktop/chromedownload/LATEST --silent
LATEST=`cat ~/Desktop/chromedownload/LATEST` 
curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/$LATEST/chrome-mac.zip -o ~/Desktop/chromedownload/chrome-mac.zip --silent 
unzip -qq ~/Desktop/chromedownload/chrome-mac.zip 
cp -R ~/Desktop/chromedownload/chrome-mac/Chromium.app /Applications
rm -rf ~/Desktop/chromedownload
 
For my own usage, I took this script and added some functionality.
- Added more verbose feedback while updating
- Compares Current installed version with newest available and will not install the same version again. (Saves Bandwidth)
- Prints old version & new for comparison's sake.
- Probably more things, but just figure it out yourself.

Code:
#!/bin/bash
if [ -e "/Applications/Chromium.app/Contents/Info.plist" ];then 
	chk=`echo "1"` 
	else 
	chk=`echo "0"` 
fi
if [ "$chk" -eq "1" ];then 
	old=`/usr/libexec/PlistBuddy -c 'Print :SVNRevision' /Applications/Chromium.app/Contents/Info.plist` 
	else 
	old=`echo "0"` 
fi
echo "Creating /tmp/chromedownload..."
mkdir /tmp/chromedownload && cd /tmp/chromedownload
echo "Checking Latest Build Number..."
curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST -o /tmp/chromedownload/LATEST --silent && LATEST=`cat /tmp/chromedownload/LATEST`
if [ "$LATEST" -eq "$old" ];then
	echo "Cleaning Up..."
	rm -rf /tmp/chromedownload
	echo "You are Already Running the Latest Build. ($LATEST)"
	exit
else
	echo "Downloading Build $LATEST..."
	curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/$LATEST/chrome-mac.zip -o /tmp/chromedownload/chrome-mac.zip --progress-bar
	echo "Unzipping..."
	unzip -qq -o /tmp/chromedownload/chrome-mac.zip
	echo "Copying to /Applications..."
	cp -R /tmp/chromedownload/chrome-mac/Chromium.app /Applications
	echo "Removing /tmp/chromedownload..."
	rm -rf /tmp/chromedownload
	if [ "$chk" -eq "1" ];then 
		echo "Chromium has been Updated from Build $old to Build $LATEST."
		else
		echo "Chromium has been Updated to Build $LATEST."
	fi
	exit
fi
fi
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.