install: better dependency installation

Try not to use aur helper, also skip already installed packages
This commit is contained in:
2 * r + 2 * t
2025-01-28 18:06:56 +11:00
parent 30937b400a
commit 303a337979
+13 -3
View File
@@ -17,6 +17,14 @@ function install-deps
# All dependencies already installed
pacman -Q $argv &> /dev/null && return
for dep in $argv
# Skip if already installed
if ! pacman -Q $dep &> /dev/null
# If pacman can install it, use it, otherwise use an AUR helper
if pacman -Si $dep &> /dev/null
log "Installing dependency '$dep'"
sudo pacman -S --noconfirm $dep
else
# Get AUR helper or install if none
which yay &> /dev/null && set -l helper yay || set -l helper paru
if ! which $helper &> /dev/null
@@ -40,9 +48,11 @@ function install-deps
end
end
# Install
log "Installing dependencies '$argv'"
$helper -S --needed --noconfirm $argv
log "Installing dependency '$dep'"
$helper -S --noconfirm $dep
end
end
end
end
function install-optional-deps