From fc1c304fdc02c8a1f32f656b1933376696faad5d Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 1 Apr 2023 15:11:44 -0500 Subject: [PATCH] Added yay check --- .bash_aliases | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index eb5e622..6f50b37 100755 --- a/.bash_aliases +++ b/.bash_aliases @@ -18,16 +18,30 @@ case "$ID" in alias burn='sudo apt-get autoremove' ;; arch|archlinux) - # Install something bypassing the prompts - alias inst='sudo pacman -S --noconfirm' - # Do a basic update - alias update='sudo pacman -Syu --noconfirm' - # Upgrade everything - alias upgrade_all='sudo pacman -Syu --noconfirm && sudo pacman -Rns $(pacman -Qdtq) --noconfirm && sudo paccache -r' - # Search packages - alias pacs='pacman -Ss' - # Uninstall - alias burn='sudo pacman -Rns --noconfirm' + # Check if yay is installed + if command -v yay >/dev/null 2>&1; then + # Install something bypassing the prompts + alias inst='yay -S --noconfirm' + # Do a basic update + alias update='yay -Syu --noconfirm' + # Upgrade everything + alias upgrade_all='yay -Syu --noconfirm && yay -Rns $(pacman -Qdtq) --noconfirm && sudo paccache -r' + # Search packages + alias pacs='yay -Ss' + # Uninstall + alias burn='yay -Rns --noconfirm' + else + # Install something bypassing the prompts + alias inst='sudo pacman -S --noconfirm' + # Do a basic update + alias update='sudo pacman -Syu --noconfirm' + # Upgrade everything + alias upgrade_all='sudo pacman -Syu --noconfirm && sudo pacman -Rns $(pacman -Qdtq) --noconfirm && sudo paccache -r' + # Search packages + alias pacs='pacman -Ss' + # Uninstall + alias burn='sudo pacman -Rns --noconfirm' + fi ;; alpine) # Install something bypassing the prompts