continue to build

This commit is contained in:
David Young
2026-03-13 19:26:29 -06:00
parent 9548cf8cd3
commit 00f6062377
6 changed files with 274 additions and 0 deletions

28
utils.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Function to check if a package is installed
is_installed() {
pacman -Qi "$1" &> /dev/null
}
# Function to check if a package is installed
is_group_installed() {
pacman -Qg "$1" &> /dev/null
}
# Function to install packages if not already installed
install_packages() {
local packages=("$@")
local to_install=()
for pkg in "${packages[@]}"; do
if ! is_installed "$pkg" && ! is_group_installed "$pkg"; then
to_install+=("$pkg")
fi
done
if [ ${#to_install[@]} -ne 0 ]; then
echo "Installing: ${to_install[*]}"
yay -S --noconfirm "${to_install[@]}"
fi
}