From 947b1a97542f6b925773dab3e67ad7e299d1191f Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Tue, 24 Jan 2023 18:06:47 +0000 Subject: [PATCH] Update file run_onchange_after_08-git-hooks.tmpl --- .../universal/run_onchange_after_08-git-hooks.tmpl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_08-git-hooks.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_08-git-hooks.tmpl index 833b54db..e72f26b2 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_08-git-hooks.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_08-git-hooks.tmpl @@ -4,9 +4,16 @@ {{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/logg" }} -### Ensure ~/.config/git/template/hooks files are executable -logg info 'Ensuring '"$XDG_CONFIG_HOME"'/git/template/hooks files are executable' -find "$XDG_CONFIG_HOME/git/template/hooks" -mindepth 1 -maxdepth 1 -type f | while read HOOK; do +{{ $gitHooks := (output "find" (joinPath .chezmoi.homeDir ".local" "src" "shared-common" "common" ".config" "husky") "-mindepth" "1" "-maxdepth" "1" "-type" "f") -}} +{{- range $gitHook := splitList "\n" $gitHooks -}} +{{- if ne $gitHook "" -}} +# {{ $gitHook }} hash: {{ include $gitHook | sha256sum }} +{{- end -}} +{{- end }} + +### Ensure git hooks are executable +logg info 'Ensuring git hooks are executable' +find "$HOME/.local/src/shared-common/common/.config/husky" -mindepth 1 -maxdepth 1 -type f | while read HOOK; do chmod +x "$HOOK" done