g_it/macupdater
Archived
1
0
Fork 0

Updated readme. Added sudo run for thw whole script.

This commit is contained in:
g 2020-09-08 18:35:11 +02:00
commit 7fa9ab7368
12 changed files with 908 additions and 34 deletions

View file

@ -1,7 +1,13 @@
#!/Users/gugulethu/brew/bin/zsh
# This script updates brew, brew cask apps, ruby gems, node packages and macOS (including system software) Apps.
# Version 10.0 (18 January 2020)
# 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)
@ -17,7 +23,7 @@ else
fi
# Set the path to the log file
export LOG=~/Projects/Programming/push/macupdater/macupdater-log.txt
export LOG=~/Desktop/macupdater-log.txt
# Export paths for appification.
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/$"
@ -50,7 +56,7 @@ fi
}
# Writes the header for the log file: Program, Version number, Date and Line.
{ echo "macupdater 10.0"; echo "Log: " `date`; line; } > $LOG
{ 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
@ -62,10 +68,10 @@ line
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