mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-11 09:49:32 -05:00
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
|
# All dependencies already installed
|
||||||
pacman -Q $argv &> /dev/null && return
|
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
|
# Get AUR helper or install if none
|
||||||
which yay &> /dev/null && set -l helper yay || set -l helper paru
|
which yay &> /dev/null && set -l helper yay || set -l helper paru
|
||||||
if ! which $helper &> /dev/null
|
if ! which $helper &> /dev/null
|
||||||
@@ -40,9 +48,11 @@ function install-deps
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Install
|
log "Installing dependency '$dep'"
|
||||||
log "Installing dependencies '$argv'"
|
$helper -S --noconfirm $dep
|
||||||
$helper -S --needed --noconfirm $argv
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function install-optional-deps
|
function install-optional-deps
|
||||||
|
|||||||
Reference in New Issue
Block a user