♻️ 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"
brew update && brew upgrade && brew cleanup
npm install npm -g && npm update -g
argparse 'h/help' 'o/update-os' -- $argv
or return
if command -v gem &>/dev/null
sudo gem update --system && sudo gem update && sudo gem cleanup
if set -q _flag_h
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
if [ "$(uname)" = "Darwin" ]
if set -q _flag_o && [ "$(uname)" = "Darwin" ]
sudo softwareupdate --install --all
else if [ "$(uname)" = "Linux" ]
sudo apt update && sudo apt upgrade
end
brew update && brew upgrade && brew cleanup
npm install npm -g && npm update -g
end