Skip to content

Instantly share code, notes, and snippets.

@statico
Created November 12, 2012 20:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save statico/4061540 to your computer and use it in GitHub Desktop.
Save statico/4061540 to your computer and use it in GitHub Desktop.
Automatically download Chromium nightly builds
#!/bin/bash
#
# Originally from "Automatically download Chromium nightly builds"
# http://top-frog.com/2010/05/29/automatically-download-chromium-nightly-builds/
LATEST=`curl -s http://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/LAST_CHANGE`
CURRENT=`defaults read /Applications/Chromium.app/Contents/Info SVNRevision 2>/dev/null`
PROCESSID=`ps ux | awk '/Chromium/ && !/awk/ {print $2}'`
if [[ $LATEST -eq $CURRENT ]]; then
echo "You're already up to date ($LATEST)"
exit 0
fi
if [ "${PROCESSID[0]}" ]; then
echo "Kill current instance of Chromium.app [y/n]"
read -n 1 -s confirmation
fi
if [ "$confirmation" = "y" ]; then
for x in $PROCESSID; do
kill -9 $x
done
else
if [ $confirmation ]; then
echo "Please close Chromium.app and restart the script"
exit 0
fi
fi
echo "Getting the latest version ($LATEST)"
curl -L "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/$LATEST/chrome-mac.zip" -o /tmp/chrome-mac.zip
wait
echo "Unzipping"
unzip -o -qq /tmp/chrome-mac.zip -d /tmp
wait
echo "Remove existing version"
rm -Rf /Applications/Chromium.app
wait
echo "Moving new version"
cp -R /tmp/chrome-mac/Chromium.app /Applications
wait
echo "Cleaning up"
rm -rf /tmp/chrome-*
echo "Done"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment