From 051f203efd5356dc9c841607f22bc839faa1943d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sun, 29 Sep 2024 18:13:31 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(fish):=20use=20to?= =?UTF-8?q?pgrade,=20yay=20or=20pacman=20when=20updating,=20installing=20a?= =?UTF-8?q?nd=20removing=20packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/fish/functions/i.fish | 6 +++++- .config/fish/functions/u.fish | 6 +++++- .config/fish/functions/up.fish | 8 +++++++- .config/fish/functions/upall.fish | 6 +++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.config/fish/functions/i.fish b/.config/fish/functions/i.fish index ea8402ad..11b8050b 100644 --- a/.config/fish/functions/i.fish +++ b/.config/fish/functions/i.fish @@ -1,3 +1,7 @@ function i --wraps='yay -S ' --description 'alias i=yay -S ' - yay -S $argv + if type -f yay &>/dev/null + yay -Sy $argv + else + pacman -Sy $argv + end end diff --git a/.config/fish/functions/u.fish b/.config/fish/functions/u.fish index f4287ec6..d6cc841d 100644 --- a/.config/fish/functions/u.fish +++ b/.config/fish/functions/u.fish @@ -1,3 +1,7 @@ function u --wraps='yay -R ' --description 'alias u=yay -R ' - yay -R $argv + if type -f yay &>/dev/null + yay -R $argv + else + pacman -R $argv + end end diff --git a/.config/fish/functions/up.fish b/.config/fish/functions/up.fish index bde8ea59..bdf7f220 100644 --- a/.config/fish/functions/up.fish +++ b/.config/fish/functions/up.fish @@ -1,3 +1,9 @@ function up --wraps='yay -Syu' --description 'alias up=yay -Syu' - yay -Syu $argv + if type -f topgrade &>/dev/null + topgrade -k --only system + else if type -f yay &>/dev/null + yay -Syu $argv + else + pacman -Syu $argv + end end diff --git a/.config/fish/functions/upall.fish b/.config/fish/functions/upall.fish index 24297b03..5011adfa 100644 --- a/.config/fish/functions/upall.fish +++ b/.config/fish/functions/upall.fish @@ -1,3 +1,7 @@ function upall --wraps=topgrade --description 'alias upall=topgrade' - topgrade $argv + if type -f topgrade + topgrade $argv + else + echo "topgrade not found" + end end