♻️ Make OS update opt-in
This commit is contained in:
parent
7cb0924619
commit
ae3d0197e6
1 changed files with 17 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue