Standardize hooks, add better key.txt bootstrapper, add update hook to detect --init

This commit is contained in:
2024-11-07 21:59:56 -06:00
parent a55abff9ac
commit a3601e0a35
4 changed files with 24 additions and 11 deletions

7
home/hooks/.update_pre.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
# chezmoi update --init does not invoke the 'hooks.init.pre' hook, so we do it ourselves
if grep -q 'init' <<<$CHEZMOI_ARGS; then
# CHEZMOI_UPDATE is just a hint in case we need to know if we're updating
CHEZMOI_UPDATE=1 $(dirname $0)/.init_pre.sh
fi