Closed remi-gelinas closed 4 years ago
I'm trying to organize related templates into subdirectories in .chezmoitemplates, but it's looking like that breaks the discovery path.
.chezmoitemplates
tests
test_template
.chezmoitemplates/tests
{{ template "tests/test_template" }}
chezmoi finds the correct template file.
--verbose
$ chezmoi diff --verbose chezmoi: template: /Users/bleh/dotfiles/src/testapply.tmpl:1:12: executing "/Users/bleh/dotfiles/src/testapply.tmpl" at <{{template "tests/test_template"}}>: template "tests/test_template" not defined
$ chezmoi doctor ok: version 1.7.12, commit bed22fcb91787c0d3d2d8ca61ebfe7799380f961, built at 2020-01-24T02:32:12Z ok: runtime.GOOS darwin, runtime.GOARCH amd64 ok: /Users/bleh/dotfiles/src (source directory, perm 700) ok: /Users/bleh (destination directory, perm 755) ok: /Users/bleh/.config/chezmoi/chezmoi.toml (configuration file) ok: /bin/zsh (shell) ok: /usr/local/bin/nvim (editor) ok: /usr/bin/vimdiff (merge command) ok: /usr/local/bin/git (source VCS command, version 2.25.0) ok: /usr/local/bin/gpg (GnuPG, version 2.2.19) warning: op (1Password CLI, not found) ok: /usr/local/bin/bw (Bitwarden CLI, version 1.8.0) warning: gopass (gopass CLI, not found) warning: keepassxc-cli (KeePassXC CLI, not found) warning: lpass (LastPass CLI, not found) warning: pass (pass CLI, not found) warning: vault (Vault CLI, not found)
Thanks for the report. Originally chezmoi used just the basename of the file as the template name, but I can't see a reason not to use the full relative path. #595 implements this.
Describe the bug
I'm trying to organize related templates into subdirectories in
.chezmoitemplates
, but it's looking like that breaks the discovery path.To reproduce
tests
directory in.chezmoitemplates
test_template
file in.chezmoitemplates/tests
{{ template "tests/test_template" }}
in a source template somewhere.Expected behavior
chezmoi finds the correct template file.
Output of command with
--verbose