[provisioning] Use paru if available on arch

This commit is contained in:
Correl Roush 2021-12-24 15:33:54 -05:00
parent 60785051ae
commit 2743f11ff9

View file

@ -16,14 +16,18 @@ function _pacman {
} }
function _yay { function _yay {
local yay=yay
if command -v paru &>/dev/null; then
yay=paru
fi
local pkg=$1 local pkg=$1
if ! yay -Qi $pkg >/dev/null 2>&1; then if ! yay -Qi $pkg >/dev/null 2>&1; then
if [ -z "$__yay_updated" ]; then if [ -z "$__yay_updated" ]; then
_run "[yay] Synchronizing package databases" yay -Syy _run "[$yay] Synchronizing package databases" $yay -Syy
__pacman_updated=yes __pacman_updated=yes
fi fi
_run "[yay] Install $pkg" yay -S --noconfirm $pkg _run "[$yay] Install $pkg" $yay -S --noconfirm $pkg
else else
echo "[yay] $pkg is already installed, skipping." echo "[$yay] $pkg is already installed, skipping."
fi fi
} }