Created
June 1, 2012 02:39
-
-
Save yanyaoer/2848236 to your computer and use it in GitHub Desktop.
Chromium update
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 | |
# Chromium update script | |
# Mac | Linux | ... | |
OS=Mac | |
BASE_URL=http://commondatastorage.googleapis.com/chromium-browser-snapshots/${OS} | |
LATEST_URL=${BASE_URL}/LAST_CHANGE | |
LATEST=$(curl ${LATEST_URL}) | |
_OS=$(tr '[A-Z]' '[a-z]'<<<${OS}) | |
APP_URL=${BASE_URL}/${LATEST}/chrome-${_OS}.zip | |
INSTALL_DIR=/Applications | |
TMP="/tmp/update-chrome-${LATEST}" | |
( | |
echo the latest version NO ${LATEST} | |
mkdir $TMP ; cd $TMP | |
echo Download with ${APP_URL} | |
curl -o chrome.zip ${APP_URL} | |
if [ $? -ne 0 ] ; then | |
echo Cannot update. | |
exit 1 | |
fi | |
echo Unzip... | |
unzip -qq chrome.zip | |
echo Copying... | |
rm -rf "${INSTALL_DIR}/Chromium.app" | |
mv chrome-$OS/Chromium.app "$INSTALL_DIR" | |
) | |
rm -rf $TMP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment