From 52d97d3f987eec812980074bf82da693b760f842 Mon Sep 17 00:00:00 2001 From: Devon Tingley Date: Wed, 5 Oct 2022 17:28:57 -0400 Subject: [PATCH] Generalize update command --- fish/functions/macos_update.fish | 5 ----- fish/functions/update.fish | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) delete mode 100644 fish/functions/macos_update.fish create mode 100644 fish/functions/update.fish diff --git a/fish/functions/macos_update.fish b/fish/functions/macos_update.fish deleted file mode 100644 index 58d4805..0000000 --- a/fish/functions/macos_update.fish +++ /dev/null @@ -1,5 +0,0 @@ -function macos_update - brew upgrade - gup update - cargo install-update --all -end diff --git a/fish/functions/update.fish b/fish/functions/update.fish new file mode 100644 index 0000000..dcfad92 --- /dev/null +++ b/fish/functions/update.fish @@ -0,0 +1,25 @@ +function update + switch (uname) + case Linux + if type -q yay + yay + end + + if type -q flatpak + flatpak update + end + case Darwin + brew upgrade + case '*' + echo "Unsupported OS" + exit 1 + end + + if type -q gup + gup update + end + + if type -q cargo + cargo install-update --all + end +end