Add omarchy-doctor checks

This commit is contained in:
Ryan Hughes
2025-09-28 00:45:37 -04:00
parent 57a977a51d
commit 9dcc6f0aec
14 changed files with 321 additions and 165 deletions

View File

@@ -1,18 +1,27 @@
#!/bin/bash
OMARCHY_DESCRIPTION="Base Packages"
# Installation function
omarchy_install() {
# Install all base packages
mapfile -t packages < <(grep -v '^#' "$OMARCHY_INSTALL/omarchy-base.packages" | grep -v '^$')
sudo pacman -S --noconfirm --needed "${packages[@]}"
# Install all base packages
mapfile -t packages < <(grep -v '^#' "$OMARCHY_INSTALL/omarchy-base.packages" | grep -v '^$')
sudo pacman -S --noconfirm --needed "${packages[@]}"
}
# Verification function
omarchy_verify() {
# Check if package list exists
[[ -f "$OMARCHY_INSTALL/omarchy-base.packages" ]] || add_error "Base packages list missing"
[[ -f "$OMARCHY_INSTALL/omarchy-base.packages" ]] || add_error "Base packages list missing"
# Check if some key base packages are installed
command -v bash >/dev/null 2>&1 || add_error "Bash not installed"
command -v sudo >/dev/null 2>&1 || add_error "Sudo not installed"
}
# Check if all base packages are installed
if [[ -f "$OMARCHY_INSTALL/omarchy-base.packages" ]]; then
mapfile -t packages < <(grep -v '^#' "$OMARCHY_INSTALL/omarchy-base.packages" | grep -v '^$')
local missing_packages=()
for package in "${packages[@]}"; do
if ! pacman -Q "$package" &>/dev/null; then
missing_packages+=("$package")
fi
done
if [[ ${#missing_packages[@]} -gt 0 ]]; then
add_error "Missing base packages: ${missing_packages[*]}"
fi
fi
}