Created
June 9, 2011 21:16
-
-
Save them/1017774 to your computer and use it in GitHub Desktop.
Quick and dirty Chromium downloader for OSX till Chromatic is updated
This file contains 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/bash | |
# Quick and dirty Chromium updater till Chromatic is updated. | |
# Beware there is no safety net, use at your own risk! | |
# Where is Chromium installed? | |
INSTALLFOLDER='/Applications/Internet'; | |
RELEASE_TYPE="snapshots" | |
# Get current installed version | |
CURRENT=$(xpath $INSTALLFOLDER/Chromium.app/Contents/Info.plist '/plist/dict/key[. = "SCMRevision"]/following-sibling::string[1]/text()' 2> /dev/null); | |
# If folder is not existing or parsing failed, force download | |
if [[ $? != 0 ]] ; then | |
CURRENT=-1; | |
fi | |
# Get latest version from Google | |
LATEST=$(curl -f -s http://commondatastorage.googleapis.com/chromium-browser-$RELEASE_TYPE/Mac/LAST_CHANGE); | |
if [[ $? != 0 ]] ; then | |
echo "Sorry, can not fetch latest version information" | |
exit 1 | |
fi | |
# Do nothing if latest version is already installed | |
if [ "$CURRENT" -ge "$LATEST" ] ; then | |
echo "Latest version already installed" | |
exit 0 | |
fi | |
echo "Current version '$CURRENT'" | |
echo "Downloading version '$LATEST' ..." | |
curl -o /tmp/chrome-mac-$LATEST.zip -f -L -# http://commondatastorage.googleapis.com/chromium-browser-$RELEASE_TYPE/Mac/$LATEST/chrome-mac.zip | |
echo "Extracting download..." | |
unzip -qq -o /tmp/chrome-mac-$LATEST.zip -d /tmp | |
rm /tmp/chrome-mac-$LATEST.zip | |
if [ -d $INSTALLFOLDER/Chromium.app ] ; then | |
mv $INSTALLFOLDER/Chromium.app ~/.Trash/Chromium.app | |
fi | |
mv /tmp/chrome-mac/Chromium.app $INSTALLFOLDER/Chromium.app | |
rm -R /tmp/chrome-mac |
Added version check. Omitting download if unnecessary.
Note to myself: do not add more features in a simple bash script, even more Perl is required
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just thought you'd like to have this. I hex edited chromatic to use the new URL's for nightlies and all is working fine now. You can download it at http://dl.--dropbox.com--/u/970025/Chromatic.zip
NOTE from TheM: remove the dashes from the domain if you really want to download it. I've not tested it and I'll wait for the official release. So use it at your own risk.