]> arthur.barton.de Git - homebrew-alex.git/blobdiff - cmd/brew-run
brew-run: Don't run "brew linkapps", will be deprecated upstream
[homebrew-alex.git] / cmd / brew-run
index a7104c91efe2db30cddffa1c9ff8a24efbf4d360..7b9ccd61039280619cbd4d69f49ab9a01e077966 100755 (executable)
@@ -1,38 +1,32 @@
 #!/bin/sh
-# 2016-01-06, alex@barton.de
+# brew-run -- Update, upgrade, and clean up Hoembrew installation.
 
 # Include "ax-common.sh":
+ax_common_sourced=
 for dir in "$HOME/lib" "$HOME/.ax" /usr/local /opt/ax /usr; do
        [ -z "$ax_common_sourced" ] || break
        ax_common="${dir}/lib/ax/ax-common.sh"
-       [ -r "$ax_common" ] && source "$ax_common"
+       # shellcheck source=/usr/local/lib/ax/ax-common.sh
+       [ -r "$ax_common" ] && . "$ax_common"
 done
 if [ -z "$ax_common_sourced" ]; then
-       function ax_msg() {
-               echo "$2"
-       }
-       function ax_abort() {
-               ax_msg - "$@"
-               exit 1
-       }
+       ax_msg() { shift; echo "$@"; }
+       ax_abort() { ax_msg - "$@"; exit 1; }
 fi
 unset dir ax_common ax_common_sourced
 
 ax_msg - "Updating Homebrew installation ..."
 brew update || ax_abort "Update failed!"
-echo
 
 outdated=$( brew outdated --quiet | wc -l | tr -d '\t ' )
 if [ $outdated -gt 0 ]; then
+       echo
        ax_msg - "$outdated formula outdated:"
-       brew outdated || ax_abort "Failed to list outdated packages!"
+       brew outdated --verbose || ax_abort "Failed to list outdated packages!"
        echo
-       brew upgrade --all || ax_abort "Upgrade failed!"
-       brew linkapps --local || ax_abort "Linking of applications failed!"
 
+       brew upgrade --cleanup || ax_abort "Upgrade failed!"
        echo
-       brew cleanup || ax_abort "\"brew cleanup\" failed!"
-       brew prune || ax_abort "\"brew prune\" failed!"
 else
-       ax_msg - "Nothing outdated."
+       ax_msg 0 "Nothing outdated."
 fi