Skip to content

Instantly share code, notes, and snippets.

@arturmartins
Last active March 7, 2024 03:09
Show Gist options
  • Save arturmartins/f779720379e6bd97cac4bbe1dc202c8b to your computer and use it in GitHub Desktop.
Save arturmartins/f779720379e6bd97cac4bbe1dc202c8b to your computer and use it in GitHub Desktop.
How to keep your mac software updated easily (2023)
#!/bin/bash
# Requirements:
# - homebrew: https://brew.sh/
# - homebrew tap: buo/cask-upgrade - https://github.com/buo/homebrew-cask-upgrade
# - homebrew mas (Mac App Store command-line interface - https://github.com/mas-cli/mas)
BREWFILE="${HOME}/Brewfile"
# Update, upgrade all and cleanup
brew update && brew upgrade && brew cu --all --yes --cleanup && mas upgrade && brew cleanup
# Dump all taps, apps, casks, mac apps and vscode extensions into Brewfile
brew bundle dump --force --describe --file="${BREWFILE}"
# Get overall stats
# grep -v '#' "${BREWFILE}" | cut -f1 -d' ' | uniq -c
# --------------------------------------------------------
# (PLEASE IGNORE this part for now. Needs testing)
# https://www.chezmoi.io/
# --------------------------------------------------------
#chezmoi add "${BREWFILE}" \
# && chezmoi cd \
# && git add "${BREWFILE##*/}" \
# && git commit -m "Updated ${BREWFILE} $(date +'%F %T')" \
# && git push
@Billi2039
Copy link

Thanks for help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment