Created
January 13, 2012 05:03
-
-
Save PatrickTulskie/1604765 to your computer and use it in GitHub Desktop.
Updater for Chromium trunk snapshots for Mac.
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/sh | |
# setup ------------------------------------------------------------------------ | |
tempDir="/tmp/`whoami`/chrome-nightly/"; | |
baseURL="http://commondatastorage.googleapis.com/chromium-browser-snapshots/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/LAST_CHANGE`; | |
checkForErrors; | |
echo " * your/latest build: $currentVersion / $latestVersion"; | |
if [ "$currentVersion" == "$latestVersion" ]; then | |
echo " * build $currentVersion is the latest one."; | |
exit 1; | |
fi | |
echo "Downloading: $baseURL/$latestVersion/$baseName.$baseExt"; | |
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 -L -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"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment