install.fairie/.local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_before_90-install-packages.tmpl

18 lines
731 B
Bash

#!/usr/bin/env bash
{{- includeTemplate "universal/profile" }}
{{- includeTemplate "universal/logg" }}
# software: {{ replace (replace (index .softwareGroups .host.softwareGroup | join " ") "[" "") "]" "" }}
if command -v install-program > /dev/null; then
if command -v zx > /dev/null; then
logg 'Installing packages defined in .chezmoidata.yaml under the .softwareGroups key'
logg 'Installing: {{ index .softwareGroups .host.softwareGroup | join " " }}'
install-program {{ replace (replace (index .softwareGroups .host.softwareGroup | join " ") "[" "") "]" "" }}
else
logg error '`zx` is not available'
fi
else
logg error '`install-program` is not in the PATH. It should be located in ~/.local/bin.'
fi