-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: keep initFuncs when using 'includeTemplate' in config
When trying to exec 'chezmoi init' or 'chezmoi apply --init' with .chezmoi.toml.tmpl including another file through 'includeTemplate', the initTemplateFuncs are only available in the first file, but not in the included template. This is because the initial execution operates on a copy of c.templateFuncs, which wouldn't get passed on to includeTemplateTemplateFunc. With this change, initFunctions will be added directly to c.templateFuncs and then removed after the config has been generated. Note: Due to a separate implementation, 'chezmoi execute-template --init' is not affected by this bug.
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters