Skip to content

Instantly share code, notes, and snippets.

@KingMob
Created March 30, 2023 05:04
Show Gist options
  • Save KingMob/39705cf11eff7b686a20e5896a5917eb to your computer and use it in GitHub Desktop.
Save KingMob/39705cf11eff7b686a20e5896a5917eb to your computer and use it in GitHub Desktop.
A script to show you outdated brew formulae, but only if they're leaves
#!/usr/bin/env bash
# A script to show you outdated brew formulae, but only if they're leaves.
# Who wants to scan through intermediate libs?
set -euo pipefail
# set -x # echo commands to terminal; for debugging
# with comm - slower for me, but may work better for you?
# FORMULAE=$(comm -12 <(brew outdated --quiet | sort) <(brew leaves))
FORMULAE=$(echo "$(brew outdated --quiet)" "$(brew leaves)" | sort | uniq -d)
brew outdated --verbose $FORMULAE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment