g_it/macupdater
Archived
1
0
Fork 0

Added an admin module that prompts for username / password to update the admin brew packages.

This commit is contained in:
g* 2019-04-07 22:58:58 +02:00
commit fd1ae473d1
50 changed files with 2978 additions and 143 deletions

View file

@ -1,10 +1,14 @@
#!/Users/gugulethu/brew/bin/zsh
# This script updates brew, brew cask apps, apm packages, ruby gems, rvm, npm packages and macOS (including system software) Apps.
# Version 6.5 (6 October, 2018)
# This script updates brew, brew cask apps, atom packages, ruby gems, node packages and macOS (including system software) Apps.
# Version 7.0 (7 April, 2019)
osascript -e 'display notification "Updater starting..." with title "MacUpdater"'
# Export paths for appification.
export PATH="/Users/gugulethu/brew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/$"
export PATH="/Users/gugulethu/brew/sbin:$PATH"
# Function: Reviews the last command for errors. Then prints update complete to log or shows error dialog. Takes section variable.
catcher () {
if [ "$?" = "0" ]; then
@ -25,18 +29,18 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> ~/Projects/Programmin
{ echo "macupdater 6.0"; echo "Log: " `date`; line; } > ~/Projects/Programming/macupdater/macupdater-log.txt
# Brew update commands.
{ echo "Brew"; echo ""; brew update; brew bundle dump --force; brew bundle -verbose; brew cleanup; brew prune; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
{ echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
catcher Brew
line
# Brew-cask update commands. Functionality replaced by brew bundle.
# { echo "Brew Cask"; echo ""; brew cu -ay --cleanup; brew cask cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
# catcher Brew-cask
# line
# Brew-cask update commands.
{ echo "Brew Cask"; echo ""; brew cu -ayf --cleanup; brew cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
catcher Brew-cask
line
# App Store update commands. Functionality replaced by brew bundle.
# { echo "Apps"; echo ""; mas upgrade; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
# catcher Apps
# App Store update commands.
{ echo "Apps"; echo ""; mas upgrade; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
catcher Apps
# Node update commands.
{ echo "Node"; echo ""; npm install npm@latest -g --silent; npm update --silent; npm prune --silent; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
@ -46,7 +50,7 @@ line
# Ruby update commands. Commented out RVM update (takes too long and not necessary).
# { rvm get latest; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
# rvm cleanup all (don't need this for now)
{ echo "Ruby"; echo ""; ; gem update --system; gem update; gem cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
{ echo "Ruby"; echo ""; gem update --system; gem update; gem cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
catcher Ruby
line
@ -55,7 +59,7 @@ line
catcher Atom
line
# Perl update commands. Commented out (don;t need uopdated Perl at the moment)
# Perl update commands. Commented out (don't need updated Perl at the moment)
# { echo "Perl"; echo ""; perlbrew upgrade-perl; perlbrew self-upgrade --silent; perlbrew clean; } >> ~/Projects/Programming/macupdater/macupdater-log.txt
# catcher Perl
# line
@ -71,6 +75,9 @@ line
# Prints and shows dialog box confirming all updates are done.
printf "All updates complete. END" >> ~/Projects/Programming/macupdater/macupdater-log.txt
osascript -e 'display notification "All updates completed." with title "MacUpdater"'
osascript -e 'display notification "All local updates completed." with title "MacUpdater"'
# Opens the admin updater for brew packages
open /Users/gugulethu/Applications/macupdater.app/Contents/Resources/macupdater-admin.app
exit 0