Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Chrome Tools
Chrome Tools (n1ckn4m3 Fork)
Chrome Tools is a collection of scripts that support users of Google's Chrome
Browser and the Chromium Project. These include:
chromium-updater.sh - Updates or installs the latest Chromium Browser.
Expand All @@ -18,3 +18,6 @@ http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/

More Detail:
http://build.chromium.org/buildbot/waterfall/console

Changelog:
n1ckn4m3 - 07/09/12: Automated killing the existing Chromium process and then restarting the browser after the upgrade.
14 changes: 12 additions & 2 deletions chromium-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ LATEST_VER=$(curl -sS $BASE_URL/LAST_CHANGE)
# Either of these could change at any moment.
FILE_NAME=chrome-mac.zip
APP_NAME=Chromium.app
APPCHK=$(ps aux | grep -c Chromium)

# check current revision number
CURRENT_VER=$(/usr/libexec/PlistBuddy -c "print SVNRevision" $APP_DIR/$APP_NAME/Contents/Info.plist) || CURRENT_VER=0
CURRENT_VER=$(/usr/libexec/PlistBuddy -c "print SCMRevision" $APP_DIR/$APP_NAME/Contents/Info.plist) || CURRENT_VER=0
CHANGELOG="http://build.chromium.org/buildbot/perf/dashboard/ui/changelog.html?url=/trunk/src&range=$LATEST_VER:$CURRENT_VER&mode=html"
echo $CHANGELOG | pbcopy
# bail if there is not a newer version
Expand All @@ -21,11 +22,20 @@ echo "Changelog (in clipboard): $CHANGELOG"

mkdir -p $TMP_DIR && cd $TMP_DIR
curl -L -O $BASE_URL/$LATEST_VER/$FILE_NAME

# I really wish they would create tar/gz files instead of zip files so that I could pipe curl to tar and not write the archive to disk.
unzip -qq $FILE_NAME

# Check for running Chromium processes and kill them if they exist.
if [ $APPCHK != '1' ];
then
killall -9 Chromium
fi

# Because this script rename the existing app with its version and moves it to the temp dir, it is safe to run while the app open.`
APP_NAME=$(basename ${FILE_NAME%%.zip}/*.app)
[[ -d $APP_DIR/$APP_NAME ]] && mv $APP_DIR/$APP_NAME ./${APP_NAME%%.app}.$CURRENT_VER.app
mv ${FILE_NAME%%.zip}/$APP_NAME $APP_DIR/$APP_NAME


# Re-open newly downloaded version of Chromium
open /$APP_DIR/$APP_NAME