Closed jloh closed 3 years ago
Is it only meant to be used within the init stage so that vars can be set there and you only use vars inside other templates, not prompting for values?
Yes, exactly this.
chezmoi needs to execute templates many times, e.g. in chezmoi diff
to show what would change. If you had to re-enter a string each time, it would quickly become tiresome.
Describe the bug
I'm trying to use the templating functionality in v2.1.6 however keep getting hit with this error:
To reproduce
promptString
in itExpected behavior
promptString
works inside templatesOutput of command with the
--verbose
flagOutput of
chezmoi doctor
Additional context
I can get
promptString
to work when its inside the main configuration file (ie.chezmoi.toml.tmpl
) and run withchezmoi init
but not within actual templates itself. eg this example from the docs works fine:Maybe my understanding of how this is meant to work is wrong. Is it only meant to be used within the init stage so that vars can be set there and you only use vars inside other templates, not prompting for values?