♻️ Make OS update opt-in

This commit is contained in:
Marley Rae 2024-01-29 21:20:47 -08:00
parent 7cb0924619
commit ae3d0197e6

View file

@ -3,16 +3,28 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function up -d "Update all software across all package managers" function up -d "Update all software across all package managers"
brew update && brew upgrade && brew cleanup argparse 'h/help' 'o/update-os' -- $argv
npm install npm -g && npm update -g or return
if command -v gem &>/dev/null if set -q _flag_h
sudo gem update --system && sudo gem update && sudo gem cleanup printf '%b' \
"Update all software across all package managers, and " \
"optionally the OS itself on macOS.\n" \
"\n" \
"Options:\n" \
"-h|--help: Show this help message.\n" \
"-o|--update-os: Update macOS, using softwareupdate. Has no effect on " \
"Linux.\n"
return
end end
if [ "$(uname)" = "Darwin" ] if set -q _flag_o && [ "$(uname)" = "Darwin" ]
sudo softwareupdate --install --all sudo softwareupdate --install --all
else if [ "$(uname)" = "Linux" ] else if [ "$(uname)" = "Linux" ]
sudo apt update && sudo apt upgrade sudo apt update && sudo apt upgrade
end end
brew update && brew upgrade && brew cleanup
npm install npm -g && npm update -g
end end