Detect packages that need to be installed before using yay.

master
Icedream 2018-02-19 09:33:58 +01:00
parent 9b61028bf4
commit 41e0609009
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 10 additions and 1 deletions

View File

@ -11,7 +11,16 @@ pacman_install() {
}
yay_install() {
yay -S --noconfirm --needed "$@"
packages=""
for package in "$@"; do
if ! pacman -Q "${package}" >/dev/null 2>&1; then
packages="${packages} ${package}"
fi
done
if [ ! -z "${packages}" ]; then
yay -S --noconfirm --needed ${packages}
fi
return 0
}
pacaur_install() {