From 244af9b838c4ebcd142f46558953c8b4c75cc873 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 4 Apr 2023 17:18:53 +0200 Subject: [PATCH] Only install yay if necessary --- scripts/Arch/Software/yay/install.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/Arch/Software/yay/install.sh b/scripts/Arch/Software/yay/install.sh index dc2d0ab3..4100899f 100755 --- a/scripts/Arch/Software/yay/install.sh +++ b/scripts/Arch/Software/yay/install.sh @@ -1,8 +1,12 @@ #!/bin/bash -sudo pacman -S --needed git base-devel -contextRoot="$(mktemp -d)"; +if ! command -v yay > /dev/null 2>&1 +then + sudo pacman -S --needed git base-devel + contextRoot="$(mktemp -d)"; + + git clone https://aur.archlinux.org/yay.git "$contextRoot"; + pushd "$contextRoot" > /dev/null; + makepkg --noconfirm -si; + popd > /dev/null; +fi; -git clone https://aur.archlinux.org/yay.git "$contextRoot"; -pushd "$contextRoot" > /dev/null; -makepkg --noconfirm -si; -popd > /dev/null;