Skip to content

Instantly share code, notes, and snippets.

@fire1ce fire1ce/brewup
Last active Nov 27, 2018

What would you like to do?
BrewUP - Upgrades Brew & Casks Packages, macOS AppStore Apps
DATE=`date '+%Y%m%d.%H%M'`
# checks if mas, terminal-notifier are installed, if not will promt to install
if [ -z $(which mas) ];
brew install mas
if [ -z $(which terminal-notifier) ];
brew install terminal-notifier
# PopUp Notification
terminal-notifier -title "BrewUP Is Working..." -message "Updates & Clean Up" -ignoreDnD
# Brew diagnotic
echo "Running Brew Diagnotic..." >&2
brew doctor >&2
brew missing >&2
echo -e "Brew Diagnotic Finished." >&2
# Brew packages update and cleanup
echo "Running Brew&Casks Updates..." >&2
brew upgrade >&2
brew cask outdated >&2
brew cask upgrade >&2
brew cleanup -s >&2
echo "Finished Brew&Casks Updates" >&2
# App Store Updates
echo "Running AppStore Updates..." >&2
mas outdated >&2
mas upgrade >&2
# Dumps Brewfile to Documents/bewConfig
mkdir /Users/${USER}/Documents/brewConfig 2> /dev/null
brew bundle dump --force --file=/Users/${USER}/Documents/brewConfig/${DATE}_Brewfile
echo "Brewfile Backup Config Has Been Created at /Users/${USER}/Documents/brewConfig/${DATE}_Brewfile"
# PopUp Notification
terminal-notifier -title "BrewUP Finished" -message "Update & Clean Up" -ignoreDnD
echo "All Updates & Cleanups Finnished"

This comment has been minimized.

Copy link
Owner Author

fire1ce commented Oct 11, 2018

installation instructions and documentation can be found at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.