Up function - to update software

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

View file

@ -1,22 +1,18 @@
#!/usr/bin/env fish #!/usr/bin/env fish
source "$DOT/script/utils.fish"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function up -d "Update all software across all package managers" function up -d "Update all software across all package managers"
set -f cmd "brew update && brew upgrade && brew cleanup" brew update && brew upgrade && brew cleanup
set -a cmd "npm install npm -g && npm update -g" npm install npm -g && npm update -g
if cmd_exists 'gem' if command -v gem &>/dev/null
set -a cmd "sudo gem update --system && sudo gem update && sudo gem cleanup" sudo gem update --system && sudo gem update && sudo gem cleanup
end end
if [ "$(uname)" = "Darwin" ] if [ "$(uname)" = "Darwin" ]
set -p cmd "sudo softwareupdate --install --all" sudo softwareupdate --install --all
else if [ "$(uname)" = "Linux" ] else if [ "$(uname)" = "Linux" ]
set -p cmd "sudo apt update && sudo apt upgrade" sudo apt update && sudo apt upgrade
end end
echo (string join '; ' $cmd)
end end