Skip to content

Instantly share code, notes, and snippets.

@fire1ce fire1ce/brewup
Last active Nov 27, 2018

Embed
What would you like to do?
BrewUP - Upgrades Brew & Casks Packages, macOS AppStore Apps
#!/bin/bash
DATE=`date '+%Y%m%d.%H%M'`
# checks if mas, terminal-notifier are installed, if not will promt to install
if [ -z $(which mas) ];
then
brew install mas
fi
if [ -z $(which terminal-notifier) ];
then
brew install terminal-notifier
fi
# 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"
@fire1ce

This comment has been minimized.

Copy link
Owner Author

commented Oct 11, 2018

installation instructions and documentation can be found at https://3os.org

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.