Skip to content

Instantly share code, notes, and snippets.

@sreetamdas
Created September 13, 2024 05:43
Show Gist options
  • Save sreetamdas/cb5773a4f08e95578f320bc529a379eb to your computer and use it in GitHub Desktop.
Save sreetamdas/cb5773a4f08e95578f320bc529a379eb to your computer and use it in GitHub Desktop.
alias to selectively upgrade brew packages
#!/bin/bash
alias brewup="brew update && brew outdated | rg '^[^ ]+' | fzf -m | tr '\n' ' ' | xargs brew upgrade"
brew update && brew outdated | rg '^[^ ]+' | fzf -m | tr '\n' ' ' | xargs brew upgrade
# __________________________ ___________ _______ ___________ __________________
# | | | | |
# | | | | ---------------- pass args to brew upgrade
# | | | --------------------------------- join multiline results to single line
# | | -------------------------------------------- use fuzzy finder to select multiple packages
# | -------------------------------------------------------- use (rip)grep to grab outdated packages' names
# ------------------------------------------------------------------------------- update and list outdated packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment