From 75b978ac6af38b226768fb8dcee602c1d90c85ff Mon Sep 17 00:00:00 2001 From: amusingimpala75 <69653100+amusingimpala75@users.noreply.github.com> Date: Mon, 19 Jun 2023 18:17:43 -0700 Subject: [PATCH] Modify configure.sh to try using an AUR helper When installing packages, if `pacman` doesn't find it in any of it's repositories, try installing it from the AUR using `yay`. --- scripts/configure.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/configure.sh b/scripts/configure.sh index c27dd481..6c4a5caf 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -20,7 +20,14 @@ function install_generic() { sudo dnf -y install "${dependency}" return 0 elif [[ "${os}" == "arch" ]]; then - sudo pacman -Sy --noconfirm "${dependency}" + if ! sudo pacman -Sy --noconfirm "${dependency}" ; then + if command -v yay > /dev/null 2>&1 ; then + sudo -u $SUDO_USER yay -Sy --noconfirm "${dependency}" + else + echo "Could not install \"${dependency}\", either using pacman or the yay AUR helper. Please try installing it manually." + return 1 + fi + fi return 0 else return 1