Skip to content

Instantly share code, notes, and snippets.

@yanyaoer
Created June 1, 2012 02:39
Show Gist options
  • Save yanyaoer/2848236 to your computer and use it in GitHub Desktop.
Save yanyaoer/2848236 to your computer and use it in GitHub Desktop.
Chromium update
#!/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