-
-
Save miketaylr/299855 to your computer and use it in GitHub Desktop.
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
This script updates to Chromium nightly. You can run it manually, but I run it using cron. | |
If you run it using cron remember that it _will quit_ your running Chromium so make sure you have it set to save tabs if you want them. | |
In order to install it with cron run: | |
crontab -e | |
Add the line: | |
0 0 * * * bash /Users/croucher/bin/chromium-nightly.sh | |
I keep my script in ~/bin/ but you should update to the appropriate command. | |
You can also alter the first two columns to reflect when you want to update. Mine is set to 0 hours, 0 minutes (midnight) but you can set any time on a 24 hour clock. |
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 | |
# Get current build for Chromium on Mac. | |
# | |
# @version 2009-05-22 | |
# @authors sh1mmer on Twitter.com | |
# Tlalox on macosxhints.com | |
# robg on macosxhints.com | |
# @todo Nothing yet | |
# setup ------------------------------------------------------------------------ | |
tempDir="/tmp/`whoami`/chrome-nightly/"; | |
baseURL="http://build.chromium.org/buildbot/snapshots/chromium-rel-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/LATEST`; | |
checkForErrors; | |
echo " * your/latest build: $currentVersion / $latestVersion"; | |
if [ "$currentVersion" == "$latestVersion" ]; then | |
echo " * build $currentVersion is the latest one."; | |
exit 1; | |
fi | |
# ------------------------------------------------------------------------------ | |
# ------------------------------------------------------------------------------ | |
echo "Downloading and unpacking..."; | |
chromePID=`ps wwaux|grep -v grep|grep "$appName"|awk '{print $2}'`; | |
curl -o $baseName.$baseExt "$baseURL/$latestVersion/$baseName.$baseExt"; | |
unzip -qo $baseName.$baseExt; | |
checkForErrors; | |
# ------------------------------------------------------------------------------ | |
# ------------------------------------------------------------------------------ | |
echo "Installing..."; | |
if [ "$chromePID" != "" ];then | |
osascript -e ' | |
tell application "System Events" | |
if exists (some process whose name contains "Chromium") then | |
tell application "Chromium" to quit | |
end if | |
end tell | |
end run' | |
fi | |
cp -r $baseName/$appName $appDir | |
checkForErrors; | |
echo $latestVersion > $version; | |
# ------------------------------------------------------------------------------ | |
# ------------------------------------------------------------------------------ | |
osascript -e 'tell application "Chromium" | |
activate | |
end tell' | |
# ------------------------------------------------------------------------------ | |
# ------------------------------------------------------------------------------ | |
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