install from packages.conf

This commit is contained in:
David Young
2026-03-15 11:03:07 -06:00
parent 1ad311e87e
commit 6be320bf5d

View File

@@ -19,12 +19,22 @@ EOF
# Install packages helper
install_packages() {
local packages=("$@")
if [[ ${#packages[@]} -eq 0 ]]; then
local conf_file="$(dirname "$0")/packages.conf"
if [ ! -f "$conf_file" ]; then
echo "Error: packages.conf not found at $conf_file"
exit 1
fi
source "$conf_file"
if [[ ${#PACKAGES[@]} -eq 0 ]]; then
echo "Warning: no packages to install."
return
fi
yay -S --needed --noconfirm "${packages[@]}"
echo "Installing ${#PACKAGES[@]} packages..."
yay -S --needed --noconfirm "${PACKAGES[@]}"
}
# Install yay AUR helper