feat: add templating for laptop dotfiles
This commit is contained in:
parent
caf6e25e43
commit
bdf7e407cb
21 changed files with 437 additions and 52 deletions
|
|
@ -8,15 +8,21 @@ _os() {
|
|||
|
||||
missing=()
|
||||
check_apply() {
|
||||
local os=$(_os)
|
||||
while IFS= read -r package; do
|
||||
cmd=$(echo "$package" | cut -d\; -f1)
|
||||
pkg=$(echo "$package" | grep -Eo "$(_os):[^ ]*" || echo ":$cmd")
|
||||
pkg=$(echo "$package" | grep -Eo "$os:[^ ]*" || echo ":$cmd")
|
||||
pkg=$(echo "$pkg" | cut -d: -f2)
|
||||
[ -n "$pkg" ] || continue
|
||||
|
||||
command -v "$cmd" >/dev/null || missing+=( "$pkg" )
|
||||
done < ~/.config/mgmt/packages
|
||||
|
||||
if [ ${#missing} -eq 0 ]; then
|
||||
diag "All packages installed"
|
||||
else
|
||||
diag "Missing ${missing[*]}"
|
||||
fi
|
||||
[ ${#missing} -eq 0 ]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue