updated boilerplate comments at top.
This commit is contained in:
parent
7a3a1a18ae
commit
8251bc61aa
1 changed files with 16 additions and 11 deletions
27
homebrew-update-notifier.sh
Normal file → Executable file
27
homebrew-update-notifier.sh
Normal file → Executable file
|
@ -1,25 +1,30 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Notify of MacPort updates via Growl on Mac OS X
|
||||
# Notify of Homebrew updates via Growl on Mac OS X
|
||||
#
|
||||
# Original Author: Chris Streeter http://www.chrisstreeter.com
|
||||
# Original Homepage: https://github.com/streeter/dotfiles/blob/master/bin/port-update-notifier
|
||||
#
|
||||
# Ported to Homebrew by: Andrew Davidson http://amdavidson.com
|
||||
# Homepage: http://github.com/amdavidson/homebrew-update-notifier
|
||||
#
|
||||
# Author: Chris Streeter http://www.chrisstreeter.com
|
||||
# Requires: Growl Notify Extra to be installed (but fails gracefully). Info
|
||||
# about how to get the extra is at http://growl.info/extras.php
|
||||
|
||||
|
||||
TERM_APP='/Applications/Terminal.app'
|
||||
PORT_EXEC='/opt/local/bin/port'
|
||||
TERM_APP='/Applications/Utilities/Terminal.app'
|
||||
BREW_EXEC='/usr/local/bin/brew'
|
||||
GROWL_NOTIFY='/usr/local/bin/growlnotify'
|
||||
GROWL_TITLE="MacPort Update(s) Available"
|
||||
GROWL_ARGS="-n 'MacPorts' -d $GROWL_NOTIFY -a $PORT_EXEC"
|
||||
GROWL_TITLE="Homebrew Update(s) Available"
|
||||
GROWL_ARGS="-n 'MacPorts' -d $GROWL_NOTIFY -a $BREW_EXEC"
|
||||
|
||||
$PORT_EXEC sync 2>&1 > /dev/null
|
||||
outdated=`$PORT_EXEC outdated`
|
||||
$BREW_EXEC update 2>&1 > /dev/null
|
||||
outdated=`$BREW_EXEC outdated`
|
||||
|
||||
if echo $outdated | grep -q 'No installed ports are outdated.' ; then
|
||||
if [ -z $outdated ] ; then
|
||||
if [ -e $GROWL_NOTIFY ]; then
|
||||
# No updates available
|
||||
$GROWL_NOTIFY $GROWL_ARGS -m '' -t "No MacPort Updates Available"
|
||||
$GROWL_NOTIFY $GROWL_ARGS -m '' -t "No Homebrew Updates Available"
|
||||
fi
|
||||
else
|
||||
# We've got an outdated port or two
|
||||
|
@ -37,6 +42,6 @@ $message"
|
|||
$message"
|
||||
fi
|
||||
# Send to growlnotify
|
||||
echo "$message" | $GROWL_NOTIFY $GROWL_ARGS -s -t $GROWL_TITLE
|
||||
echo "$message" | $GROWL_NOTIFY $GROWL_ARGS -t $GROWL_TITLE
|
||||
fi
|
||||
fi
|
Loading…
Reference in a new issue