Skip to content

Commit

Permalink
docs: Add FAQ entry on running a script when a git-repo external changes
Browse files Browse the repository at this point in the history
Co-authored-by: ErrrorMaxx <[email protected]>
Co-authored-by: Misaka <[email protected]>
  • Loading branch information
3 people committed Sep 9, 2024
1 parent b56a600 commit a3de4a8
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ results in
{{ .Target }}
```

## How do I run a script when a `git-repo` external changes?

Use a `run_onchange_after_*.tmpl` script that includes the HEAD commit. For example,
if `~/.emacs.d` is a `git-repo` external, then create:

``` title="~/.local/share/chezmoi/run_onchange_after_emacs.d.tmpl"
#!/bin/sh
# {{ output "git" "-C" (joinPath .chezmoi.homeDir ".emacs.d") "rev-parse" "HEAD" }}
echo "~/emacs.d updated"
```

## How do I enable shell completions?

chezmoi includes shell completions for
Expand Down

0 comments on commit a3de4a8

Please sign in to comment.