blind mgmt setup

This commit is contained in:
Robert Perce 2026-01-29 23:39:06 -06:00
parent 87f5dfcdf8
commit 074131bb54
5 changed files with 201 additions and 0 deletions

View file

@ -0,0 +1,32 @@
_os() {
if command -v termux-setup-storage >/dev/null; then
echo "termux"
else
grep '^ID=' /etc/os-release | cut -d= -f2
fi
}
missing=()
check_apply() {
while IFS= read -r package; do
cmd=$(echo "$package" | cut -d\; -f1)
pkg=$(echo "$package" | grep -Eo "$(_os):[^ ]+" || echo ":$cmd")
pkg=$(echo "$pkg" | cut -d: -f2)
[ -n "$pkg" ] || next
command -v "$cmd" >/dev/null || missing+=( "$pkg" )
done < ~/.config/mgmt/packages
[ ${#missing} -eq 0 ]
}
apply() {
case "$(_os)" in
ubuntu) manager="apt install" ;;
arch) manager="pacman -Syu" ;;
termux) manager="pkg install" ;;
*) return 1 ;;
esac
$manager "${missing[@]}"
}

View file

@ -0,0 +1 @@
nvim; termux:neovim arch:neovim ubuntu: