Last active
August 29, 2015 14:04
-
-
Save AlexKMDev/30b26d6fc7ca3e76825a to your computer and use it in GitHub Desktop.
homebrew outdated packages notification
This file contains 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
# put this to crontab | |
@daily ~/notify.sh | |
# for automatic updates (not upgrades) | |
@daily /usr/local/bin/brew update > /dev/null 2>&1 |
This file contains 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 | |
OSASCRIPT_PATH=$(which osascript) | |
BREW_PATH=/usr/local/bin/brew | |
OUTDATED_PKGS=$($BREW_PATH outdated --verbose) | |
if [ -z "$OSASCRIPT_PATH" ]; then | |
echo "Osascript isn't installed!" | |
exit 1 | |
fi | |
if [ -z "$BREW_PATH" ]; then | |
echo "Homebrew isn't installed!" | |
exit 1 | |
fi | |
if ! [ -z "$OUTDATED_PKGS" ]; then | |
$OSASCRIPT_PATH -e "display notification \"$OUTDATED_PKGS\" with title \"Outdated packages\" sound name \"Glass\"" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment