dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit d6c1b2ca52c99fa2947bee61a11fefe11c1f9d0b
parent eda4a36c6c59d944299ef66aee71d27baa830fc6
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Wed, 16 May 2018 18:37:57 +0200

Simplified brewmaster output if there are no packages to upgrade.

Diffstat:
M.commonprofile | 35++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/.commonprofile b/.commonprofile @@ -53,21 +53,26 @@ notify() { brewmaster() { brew update; - brew update; - echo "\nTo update:\n" - brew outdated; - brew cask outdated; - notify "Finished reading updates" "Click to view outdated packages." - echo -n "Continue? [Y/n]" - read -sqn CONF - - if [ "$CONF" != "y" ]; then - echo "\nUser cancelled." - return 1 - fi - echo "\nContinuing with upgrade." - brew upgrade; - brew cask upgrade; + brew update > /dev/null; + outdated="$(brew outdated) $(brew cask outdated)" + if [ ${#outdated} = 1 ]; then + echo "Nothing to update." + else + echo "\nTo update:\n" + brew outdated; + brew cask outdated; + notify "Finished reading updates" "Click to view outdated packages." + echo -n "Continue? [Y/n]" + read -sqn CONF + + if [ "$CONF" != "y" ]; then + echo "\nUser cancelled." + return 1 + fi + echo "\nContinuing with upgrade." + brew upgrade; + brew cask upgrade; + fi brew cleanup -s; brew cask cleanup; brew prune;