run_onchange_after_mise-install.sh.tmpl hashed the raw contents of
config.toml.tmpl to detect changes, but that file only pulls in real
content through named templates ({{ template "..." }}) fed by
.chezmoidata. Editing that data left the raw .tmpl text (and thus the
hash) unchanged, so mise install silently stopped firing.
Switch the named-template calls to includeTemplate, which chezmoi can
resolve outside the normal source-state parsing pass (unlike the
template action, see https://github.com/twpayne/chezmoi/issues/3334).
This lets the run_onchange script hash the actual rendered output via
includeTemplate instead of the static source text.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
21 lines
696 B
Cheetah
21 lines
696 B
Cheetah
#!/usr/bin/env bash
|
|
# Déclencheur automatique : ce script se réexécutera si le config.toml de mise change,
|
|
# y compris quand seules les données (.chezmoidata) utilisées par ses templates changent.
|
|
# hash: {{ includeTemplate "private_dot_config/mise/config.toml.tmpl" . | sha256sum }}
|
|
|
|
export PATH="${HOME}/.local/bin:$PATH"
|
|
|
|
if command -v mise &>/dev/null; then
|
|
echo "✏️ Modification de la configuration mise détectée."
|
|
|
|
echo
|
|
echo "🚀 Mise bootstrap..."
|
|
mise bootstrap --yes
|
|
|
|
echo
|
|
echo "⚡ Mise install..."
|
|
mise install --yes
|
|
else
|
|
echo "⚠️ mise n'est pas installé sur ce système. Impossible de lancer l'installation automatique des outils."
|
|
fi
|