diff --git a/install.sh b/install.sh index fc7dbce..7d91098 100755 --- a/install.sh +++ b/install.sh @@ -87,27 +87,33 @@ cd ~/ # Install yay AUR helper if not present -if ! command -v yay &> /dev/null; then - echo "Installing yay AUR helper..." - sudo pacman -S --needed git base-devel --noconfirm - if [[ ! -d "yay" ]]; then - echo "Cloning yay repository..." - else - echo "yay directory already exists, removing it..." - rm -rf yay - fi - - git clone https://aur.archlinux.org/yay.git - - cd yay - echo "building yay.... yaaaaayyyyy" - makepkg -si --noconfirm - cd .. - rm -rf yay -else - echo "yay is already installed" +if command -v yay &> /dev/null; then + echo "yay is already installed, skipping." + exit 0 fi +echo "Installing yay AUR helper..." +sudo pacman -S --needed --noconfirm git base-devel + +# Clean up any leftover yay directory from a previous failed install +if [[ -d "yay" ]]; then + echo "Removing leftover yay directory..." + rm -rf yay +fi + +echo "Cloning yay repository..." +git clone https://aur.archlinux.org/yay.git + +echo "Building yay..." +cd yay +makepkg -si --noconfirm +cd .. + +echo "Cleaning up..." +rm -rf yay + +echo "yay installed successfully." + # Install packages by category if [[ "$DEV_ONLY" == true ]]; then