diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5ced0f6..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -macupdater-log.txt -.gitignore -.DS_Store diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 73bf615..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 g* - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/macupdater.app/Contents/Info.plist b/macupdater.app/Contents/Info.plist deleted file mode 100644 index 5ed58e3..0000000 Binary files a/macupdater.app/Contents/Info.plist and /dev/null differ diff --git a/macupdater.app/Contents/MacOS/macupdater b/macupdater.app/Contents/MacOS/macupdater deleted file mode 100755 index 249a99b..0000000 Binary files a/macupdater.app/Contents/MacOS/macupdater and /dev/null differ diff --git a/macupdater.app/Contents/Resources/AppIcon.icns b/macupdater.app/Contents/Resources/AppIcon.icns deleted file mode 100644 index 0fcf8ed..0000000 Binary files a/macupdater.app/Contents/Resources/AppIcon.icns and /dev/null differ diff --git a/macupdater.app/Contents/Resources/AppSettings.plist b/macupdater.app/Contents/Resources/AppSettings.plist deleted file mode 100644 index b3d35f3..0000000 Binary files a/macupdater.app/Contents/Resources/AppSettings.plist and /dev/null differ diff --git a/macupdater.app/Contents/Resources/MainMenu.nib/designable.nib b/macupdater.app/Contents/Resources/MainMenu.nib/designable.nib deleted file mode 100644 index 59df482..0000000 --- a/macupdater.app/Contents/Resources/MainMenu.nib/designable.nib +++ /dev/null @@ -1,705 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/macupdater.app/Contents/Resources/MainMenu.nib/keyedobjects.nib b/macupdater.app/Contents/Resources/MainMenu.nib/keyedobjects.nib deleted file mode 100644 index f215593..0000000 Binary files a/macupdater.app/Contents/Resources/MainMenu.nib/keyedobjects.nib and /dev/null differ diff --git a/macupdater.app/Contents/Resources/script b/macupdater.app/Contents/Resources/script deleted file mode 100755 index 36f3def..0000000 --- a/macupdater.app/Contents/Resources/script +++ /dev/null @@ -1,110 +0,0 @@ -#!/Users/gugulethu/brew/bin/zsh - -# This script updates brew, brew cask apps, ruby gems, node packages and macOS (including system software) Apps. -# Version 10.1.1 (08 September 2020) - -# Ask for the password up-front -sudo -v - -# Keep-alive: update existing sudo time stamp if set, otherwise do nothing. -while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & - -# Open an alert that requires the user the click RUN to start the process. -ANSWER=$(./alerter -message "Run an update?" -actions Run -title macupdater -timeout 10 -sound default) - -# Check the response from the alert and close if it is anything but RUN. -if [ $ANSWER = "@TIMEOUT" ]; then - echo "NOTIFICATION: Update process exited." - exit -elif [ $ANSWER = "@CLOSED" ]; then - exit -else - echo "NOTIFICATION: Updater starting..." # Send a notification (with logo) -fi - -# Set the path to the log file -export LOG=~/Desktop/macupdater-log.txt - -# Export paths for appification. -export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/$" - -# 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." >> $LOG # If no error, print update complete to file. - printf "" >> $LOG # Add a line to file. -else # If error, show a dialog stating the section where the error occured. - echo "NOTIFICATION: '$1' updates failed." - ERROR=1 # Sets variable for error in script to 1. -fi -} - -# Function: Creates a horizontal line in the text file. -line () { -echo "" >> $LOG # Starts the horizontal line on its own fresh line. -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> $LOG # Prints line -} - -# Function: If there has been an error in the script open the log file. -verify () { -if [ $ERROR = 1 ]; then - open $LOG - echo "NOTIFICATION: Updates completed with some errors." -else - echo "NOTIFICATION: Updates completed." -fi -} - -# Writes the header for the log file: Program, Version number, Date and Line. -{ echo "macupdater 10.1.1"; echo "Log: " `date`; line; } > $LOG - -# Brew update commands. -{ trash -rf $(brew --cache); echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; } >> $LOG -catcher Brew -line - -# Brew-cask update commands. -{ echo "Brew Cask"; echo ""; brew cu -ayf --cleanup; } >> $LOG -catcher Brew-cask -line - -# # Push and pull all git remotes. -# { cd Projects/Programming/push/;find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push \; cd Projects/Programming/pull/; find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; } >> $LOG -# catcher Git-remote -# line - -# Node update commands. -{ echo "Node"; echo ""; npm install npm@latest -g; npm update; npm prune; } >> $LOG -catcher Node -line - -# Ruby update commands. -{ echo "Ruby"; echo ""; gem update --system; gem cleanup; } >> $LOG -catcher Ruby -line - -# Perl update commands. -# { echo "Perl"; echo ""; perlbrew self-upgrade; perlbrew upgrade-perl; perlbrew clean; } >> $LOG -# catcher Perl -# line - -# Python update commands. -{ echo "Python"; echo ""; pip install -U pip; } >> $LOG -catcher Python -line - -# App Store update commands. -{ echo "Apps"; echo ""; mas upgrade; } >> $LOG -catcher Apps -line - -# System software update commads. -{ echo "macOS"; echo ""; softwareupdate -ia; } >> $LOG -catcher macOS -line - -# Prints and shows dialog box confirming all updates are done. -printf "All updates complete. END" >> $LOG -verify $ERROR - -echo "QUITAPP" \ No newline at end of file diff --git a/macupdater.sh b/macupdater.sh index 36f3def..e6ab4bb 100755 --- a/macupdater.sh +++ b/macupdater.sh @@ -59,19 +59,19 @@ fi { echo "macupdater 10.1.1"; echo "Log: " `date`; line; } > $LOG # Brew update commands. -{ trash -rf $(brew --cache); echo "Brew"; echo ""; brew update; brew upgrade; brew cleanup; } >> $LOG +{ trash -rf $(brew --cache); echo "Brew"; echo ""; brew update; brew upgrade $(brew outdated --formula -q); brew cleanup; } >> $LOG catcher Brew line # Brew-cask update commands. -{ echo "Brew Cask"; echo ""; brew cu -ayf --cleanup; } >> $LOG +{ echo "Brew Cask"; echo ""; brew cu -ayf --no-quarantine --cleanup; } >> $LOG catcher Brew-cask line -# # Push and pull all git remotes. -# { cd Projects/Programming/push/;find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push \; cd Projects/Programming/pull/; find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; } >> $LOG -# catcher Git-remote -# line +# Push and pull all git remotes. +{ cd Projects/Programming/push/;find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push \; cd Projects/Programming/pull/; find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; } >> $LOG +catcher Git-remote +line # Node update commands. { echo "Node"; echo ""; npm install npm@latest -g; npm update; npm prune; } >> $LOG @@ -89,7 +89,7 @@ line # line # Python update commands. -{ echo "Python"; echo ""; pip install -U pip; } >> $LOG +{ echo "Python"; echo ""; pip3 install -U pip; } >> $LOG catcher Python line @@ -103,8 +103,13 @@ line catcher macOS line +# Remove the quarantine flag for all applications +{ xattr -r -d com.apple.quarantine /Applications/; } >> $LOG +catcher NoQuarantine +line + # Prints and shows dialog box confirming all updates are done. printf "All updates complete. END" >> $LOG verify $ERROR -echo "QUITAPP" \ No newline at end of file +echo "QUITAPP" diff --git a/readme.md b/readme.md old mode 100644 new mode 100755 index 77442e2..960614d --- a/readme.md +++ b/readme.md @@ -1,8 +1,8 @@ -![macupdater logo](https://gugulet.hu/site/wp-content/uploads/macupdater-logo-1200x600-1.png) +# macupdater -[![License: MIT](https://img.shields.io/badge/License-MIT-red.svg)](https://opensource.org/licenses/MIT) +![Shell](https://img.shields.io/badge/zsh-F15A24?style=flat&logo=zsh&logoColor=white) ![Status](https://img.shields.io/badge/Status-inactive-orange) [![License: MIT](https://img.shields.io/badge/License-MIT-red.svg)](https://opensource.org/licenses/MIT) -Package managment on macOS is a challenge. This is my amateurish attempt to combine all my package updates into one app. This app updates brew, brew cask apps, apm packages, ruby gems, rvm, npm packages and macOS (including system software) Apps. Note: the app only runs in admin account as it needs admin privileges. +> Package management on macOS is a challenge. This is my amateurish attempt to combine all my package updates into one app. This app updates brew, brew cask apps, apm packages, ruby gems, rvm, npm packages and macOS (including system software) apps. The app only runs in admin account as it needs admin privileges. ## Before you start @@ -10,13 +10,13 @@ This app relies on [alerter](https://github.com/vjeantet/alerter) for its notifi ## Packages supported -- [Brew](https://brew.sh/) -- [Brew Casks](https://github.com/buo/homebrew-cask-upgrade) -- [npm](https://www.npmjs.com/) -- Ruby -- Python [(pip)](https://github.com/pypa/pip) -- [mas](https://github.com/mas-cli/mas) -- macOS software updates +- [Brew](https://brew.sh/) +- [Brew Casks](https://github.com/buo/homebrew-cask-upgrade) +- [npm](https://www.npmjs.com/) +- Ruby +- Python [(pip)](https://github.com/pypa/pip) +- [mas](https://github.com/mas-cli/mas) +- macOS software updates ## Editing the script @@ -65,7 +65,7 @@ export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/$" ### Functions -The app has three functions: one to check the last update commands for errors, one to create a horizontal line in the log file and the last to open the log file at the end if there has been an error. I won;t go itno the functions here. You can read their comments in the file. +The app has three functions: one to check the last update commands for errors, one to create a horizontal line in the log file and the last to open the log file at the end if there has been an error. I won't go itno the functions here. You can read their comments in the file. ### Update commands @@ -84,7 +84,7 @@ I use [Platypus](https://github.com/sveinbjornt/platypus) to convert the script ### Problems -The biggest problem I have right now is that this app needs to be run as an admin user. I prefer to use a non-admin account day-to-day so I'm going to have to tackle the run as another user problem soon. Running as a non-admin causes the brew and brew-cask updates to fail. +The biggest problem I have right now is that this app needs to be run as an admin user. I prefer to use a non-admin account day-to-day so I'm going to have to tackle the run-as-another-user problem soon. Running as a non-admin causes the brew and brew-cask updates to fail. ## License