Only install yay if necessary

This commit is contained in:
Manuel Thalmann 2023-04-04 17:18:53 +02:00
parent b54153fd7a
commit 24abd8b21a

View file

@ -1,8 +1,12 @@
#!/bin/bash #!/bin/bash
sudo pacman -S --needed git base-devel if ! command -v yay > /dev/null 2>&1
contextRoot="$(mktemp -d)"; 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;