diff options
| author | Egor Tensin <egor@tensin.name> | 2026-09-28 14:38:36 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-09-28 14:38:36 +0500 |
| commit | fb9bb9682db75f91e0433f9b404c40984ab4d2c3 (patch) | |
| tree | 1395c29452f500d955536c2a731f219573f0f884 /%HOME% | |
| parent | bash: add some Arch-specific shortcuts (diff) | |
| download | linux-home-fb9bb9682db75f91e0433f9b404c40984ab4d2c3.tar.gz linux-home-fb9bb9682db75f91e0433f9b404c40984ab4d2c3.zip | |
arch.sh: refactor some routines
Diffstat (limited to '%HOME%')
| -rw-r--r-- | %HOME%/.bash_utils/arch.sh | 23 |
1 files 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 "$@" -) |
