forked from Shinonome/caelestia-cli
install: better dependency installation
Try not to use aur helper, also skip already installed packages
This commit is contained in:
+13
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user