commit 804479f705482261c199a2f90479391192cab9ef Author: g* Date: Sat Jun 30 19:57:54 2018 +0200 Initialising project diff --git a/macupdater-log.txt b/macupdater-log.txt new file mode 100644 index 0000000..2d223ac --- /dev/null +++ b/macupdater-log.txt @@ -0,0 +1,92 @@ +macupdater 6.0 +Log: Sat Jun 30 19:33:55 SAST 2018 + + +Brew + +Already up-to-date. +Brew updates complete. + +Brew Cask + +==> Options +Include auto-update (-a): true +Include latest (-f): false +==> Updating Homebrew +Already up-to-date. +==> Finding outdated apps + Cask Current Latest A/U Result + 1/28 adapter 2.1.6 2.1.6 [ OK ] + 2/28 android-platf... 28.0.0 28.0.0 [ OK ] + 3/28 artpip latest latest [ OK ] + 4/28 boom-3d 1.1.4,1527055860 1.1.4,1527055860 [ OK ] + 5/28 brackets 1.13 1.13 [ OK ] + 6/28 carbon-copy-c... 5.1.2.5426 5.1.2.5426 Y [ OK ] + 7/28 cheatsheet 1.2.9 1.2.9 [ OK ] + 8/28 codekit 3.6.1,26680 3.6.1,26680 Y [ OK ] + 9/28 controlplane 1.6.6 1.6.6 [ OK ] +10/28 cyberduck 6.6.2.28219 6.6.2.28219 Y [ OK ] +11/28 disk-drill 3.5.890 3.5.890 [ OK ] +12/28 flux 39.987 39.987 Y [ OK ] +13/28 fork 1.0.67.5 1.0.67.5 Y [ OK ] +14/28 iina 0.0.15.1 0.0.15.1 Y [ OK ] +15/28 itsycal 0.11.10 0.11.10 [ OK ] +16/28 knockknock 1.9.3 1.9.3 [ OK ] +17/28 libreoffice 6.0.5 6.0.5 [ OK ] +18/28 platypus 5.2 5.2 Y [ OK ] +19/28 qlcolorcode 2.1.0 2.1.0 [ OK ] +20/28 qlmarkdown 1.3.5 1.3.5 [ OK ] +21/28 qlprettypatch 1.0 1.0 [ OK ] +22/28 qlstephen 1.4.4 1.4.4 [ OK ] +23/28 quicksilver 1.5.9 1.5.9 Y [ OK ] +24/28 signal 1.13.0 1.13.0 Y [ OK ] +25/28 sketchup 2017 2017 [ OK ] +26/28 transmission 2.94 2.94 Y [ OK ] +27/28 vivaldi 1.15.1147.47 1.15.1147.47 Y [ OK ] +28/28 ynab 4.3.855 4.3.855 [ OK ] +==> Removing cached downloads +Nothing to do +Brew-cask updates complete. + +Node + +/Users/gugulethu/homebrew/bin/npm -> /Users/gugulethu/homebrew/lib/node_modules/npm/bin/npm-cli.js +/Users/gugulethu/homebrew/bin/npx -> /Users/gugulethu/homebrew/lib/node_modules/npm/bin/npx-cli.js ++ npm@6.1.0 +updated 1 package in 18.261s +up to date in 2.159s +found 0 vulnerabilities + +Node updates complete. + +Ruby + +Updating rubygems-update +Updating installed gems +Updating CFPropertyList +Cleaning up installed gems... +Clean Up Complete +Ruby updates complete. + +Perl + +no perlbrew environment is currently in use +Your perlbrew is up-to-date. + +Done +Perl updates complete. + +macOS + +Software Update Tool + +Finding available software +macOS updates complete. + +Apps + +Everything is up-to-date +Apps updates complete. + + +All updates complete. END \ No newline at end of file diff --git a/macupdater-logo-2500x2500.afdesign b/macupdater-logo-2500x2500.afdesign new file mode 100644 index 0000000..6d652b7 Binary files /dev/null and b/macupdater-logo-2500x2500.afdesign differ diff --git a/macupdater-logo-2500x2500.png b/macupdater-logo-2500x2500.png new file mode 100644 index 0000000..21dcaa2 Binary files /dev/null and b/macupdater-logo-2500x2500.png differ diff --git a/macupdater.app/Contents/Info.plist b/macupdater.app/Contents/Info.plist new file mode 100644 index 0000000..77783eb Binary files /dev/null and b/macupdater.app/Contents/Info.plist differ diff --git a/macupdater.app/Contents/MacOS/macupdater b/macupdater.app/Contents/MacOS/macupdater new file mode 100755 index 0000000..d4f4459 Binary files /dev/null and b/macupdater.app/Contents/MacOS/macupdater differ diff --git a/macupdater.app/Contents/Resources/AppSettings.plist b/macupdater.app/Contents/Resources/AppSettings.plist new file mode 100644 index 0000000..8f21a50 Binary files /dev/null and b/macupdater.app/Contents/Resources/AppSettings.plist differ diff --git a/macupdater.app/Contents/Resources/MainMenu.nib/designable.nib b/macupdater.app/Contents/Resources/MainMenu.nib/designable.nib new file mode 100644 index 0000000..014a9a7 --- /dev/null +++ b/macupdater.app/Contents/Resources/MainMenu.nib/designable.nib @@ -0,0 +1,569 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macupdater.app/Contents/Resources/MainMenu.nib/keyedobjects.nib b/macupdater.app/Contents/Resources/MainMenu.nib/keyedobjects.nib new file mode 100644 index 0000000..8d20692 Binary files /dev/null and b/macupdater.app/Contents/Resources/MainMenu.nib/keyedobjects.nib differ diff --git a/macupdater.app/Contents/Resources/appIcon.icns b/macupdater.app/Contents/Resources/appIcon.icns new file mode 100644 index 0000000..e726544 Binary files /dev/null and b/macupdater.app/Contents/Resources/appIcon.icns differ diff --git a/macupdater.app/Contents/Resources/script b/macupdater.app/Contents/Resources/script new file mode 100755 index 0000000..ffee7c7 --- /dev/null +++ b/macupdater.app/Contents/Resources/script @@ -0,0 +1,64 @@ +#!/bin/sh +# This script updates brew, brew cask apps, ruby gems, rvm, npm packages and macOS (including system software) Apps. +# Version 6.0 (30 June, 2018) + +# Function: Reviews the last command for errors. Then prints update complete to log or shows error dialog. Takes section variable. +catcher () { +if [ "$?" = "0" ]; then + printf "$1 updates complete." >> ~/Projects/Programming/macupdater/macupdater-log.txt # If no error, print update complete to file. + printf "" >> ~/Projects/Programming/macupdater/macupdater-log.txt # Add a line to file. +else # If error, show a dialog stating the section where the error occured. + osascript -e 'display notification "'$1': Script encountered errors." with title "MacUpdater"' +fi +} + +# Function: Creates a horizontal line in the text file. +line () { +echo "" >> ~/Projects/Programming/macupdater/macupdater-log.txt # Starts the horizontal line on its own fresh line. +printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> ~/Projects/Programming/macupdater/macupdater-log.txt # Prints line +} + +# Writes the header for the log file: Program, Version number, Date and Line. +{ echo "macupdater 6.0"; echo "Log: " `date`; line; } > ~/Projects/Programming/macupdater/macupdater-log.txt + +# Brew update commands. +{ echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; brew prune; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Brew +line + +# Brew-cask update commands. +{ echo "Brew Cask"; echo ""; brew cu -ay --cleanup; brew cask cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Brew-cask +line + +# Node update commands. +{ echo "Node"; echo ""; npm install npm@latest -g --silent; npm update --silent; npm prune --silent; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Node +line + +# Ruby update commands. Commented out RVM update. +# { rvm get latest; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +{ echo "Ruby"; echo ""; rvm cleanup all; gem update --system; gem update; gem cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Ruby +line + +# Perl update commands. +{ echo "Perl"; echo ""; perlbrew upgrade-perl; perlbrew self-upgrade --silent; perlbrew clean; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Perl +line + +# System software update commads. +{ echo "macOS"; echo ""; softwareupdate -ia; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher macOS +line + +# App Store update commands. +{ echo "Apps"; echo ""; mas upgrade; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Apps + +echo "" >> ~/Projects/Programming/macupdater/macupdater-log.txt +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"' \ No newline at end of file diff --git a/macupdater.sh b/macupdater.sh new file mode 100755 index 0000000..ffee7c7 --- /dev/null +++ b/macupdater.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# This script updates brew, brew cask apps, ruby gems, rvm, npm packages and macOS (including system software) Apps. +# Version 6.0 (30 June, 2018) + +# Function: Reviews the last command for errors. Then prints update complete to log or shows error dialog. Takes section variable. +catcher () { +if [ "$?" = "0" ]; then + printf "$1 updates complete." >> ~/Projects/Programming/macupdater/macupdater-log.txt # If no error, print update complete to file. + printf "" >> ~/Projects/Programming/macupdater/macupdater-log.txt # Add a line to file. +else # If error, show a dialog stating the section where the error occured. + osascript -e 'display notification "'$1': Script encountered errors." with title "MacUpdater"' +fi +} + +# Function: Creates a horizontal line in the text file. +line () { +echo "" >> ~/Projects/Programming/macupdater/macupdater-log.txt # Starts the horizontal line on its own fresh line. +printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> ~/Projects/Programming/macupdater/macupdater-log.txt # Prints line +} + +# Writes the header for the log file: Program, Version number, Date and Line. +{ echo "macupdater 6.0"; echo "Log: " `date`; line; } > ~/Projects/Programming/macupdater/macupdater-log.txt + +# Brew update commands. +{ echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; brew prune; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Brew +line + +# Brew-cask update commands. +{ echo "Brew Cask"; echo ""; brew cu -ay --cleanup; brew cask cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Brew-cask +line + +# Node update commands. +{ echo "Node"; echo ""; npm install npm@latest -g --silent; npm update --silent; npm prune --silent; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Node +line + +# Ruby update commands. Commented out RVM update. +# { rvm get latest; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +{ echo "Ruby"; echo ""; rvm cleanup all; gem update --system; gem update; gem cleanup; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Ruby +line + +# Perl update commands. +{ echo "Perl"; echo ""; perlbrew upgrade-perl; perlbrew self-upgrade --silent; perlbrew clean; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Perl +line + +# System software update commads. +{ echo "macOS"; echo ""; softwareupdate -ia; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher macOS +line + +# App Store update commands. +{ echo "Apps"; echo ""; mas upgrade; } >> ~/Projects/Programming/macupdater/macupdater-log.txt +catcher Apps + +echo "" >> ~/Projects/Programming/macupdater/macupdater-log.txt +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"' \ No newline at end of file