Only install yay if needed

This commit is contained in:
Ben Record
2025-08-06 17:47:00 -06:00
parent 879dba81c8
commit cc5242e2c2

View File

@@ -11,7 +11,9 @@ print_info "\nStarting prerequisites setup..."
run_command "pacman -Syyu --noconfirm" "Update package database and upgrade packages (Recommended)" "yes" # no
if run_command "pacman -S --noconfirm --needed git base-devel" "Install YAY (Must)/Breaks the script" "yes"; then #
if command -v yay > /dev/null; then
print_info "Skipping yay installation (already installed)."
elif run_command "pacman -S --noconfirm --needed git base-devel" "Install YAY (Must)/Breaks the script" "yes"; then #
run_command "git clone https://aur.archlinux.org/yay.git && cd yay" "Clone YAY (Must)/Breaks the script" "no" "no"
run_command "makepkg --noconfirm -si && cd .. # builds with makepkg" "Build YAY (Must)/Breaks the script" "no" "no"
fi