From fb9bb9682db75f91e0433f9b404c40984ab4d2c3 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 28 Sep 2026 14:38:36 +0500 Subject: arch.sh: refactor some routines --- %HOME%/.bash_utils/arch.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/%HOME%/.bash_utils/arch.sh b/%HOME%/.bash_utils/arch.sh index 6b2fc2f..4d83a07 100644 --- a/%HOME%/.bash_utils/arch.sh +++ b/%HOME%/.bash_utils/arch.sh @@ -3,13 +3,23 @@ # For details, see https://github.com/egor-tensin/linux-home # Distributed under the MIT License. +yay_upgrade() ( + _bash_func_prelude + yay -Syua --noconfirm --needed --cleanafter +) + +yay_install() ( + _bash_func_prelude + yay -Sy --noconfirm --needed --cleanafter "$@" +) + arch_upgrade() ( _bash_func_prelude echo ====================================================================== sudo pacman -Syu --noconfirm echo ====================================================================== - yay -Syua --noconfirm --needed --cleanafter + yay_upgrade echo ====================================================================== local reboot_timeout=10 @@ -22,13 +32,12 @@ arch_cleanup() ( _bash_func_prelude echo ====================================================================== - pacman -Qqdt | sudo pacman -Rcsn --noconfirm - + local output + output="$( pacman -Qqdt )" || true + if [ -n "$output" ]; then + echo "$output" | sudo pacman -Rcsn --noconfirm - + fi echo ====================================================================== yay -Sca --noconfirm echo ====================================================================== ) - -arch_yay_install() ( - _bash_func_prelude - yay -Sy --noconfirm --needed --cleanafter "$@" -) -- cgit v1.3