-
Basic problemfrom the docs it seems like doing chezmoi add --autotemplate should add .tmpl to the chezmoi file, but it doesn't seem to be doing that (--template is not implied?) it also seems like based on the issue below that --autotemplate should escape {{{ or {{ if it exists in the file, but it doesn't? https://www.chezmoi.io/user-guide/manage-machine-to-machine-differences/ #723
BackgroundI want to add some templating to my .zshrc file but it has a bunch of {{{ foldmarker blocks which causes chezmoi to die with the following error: Maybe I'm doing this wrong, or maybe it's not supported and I'm interpreting the docs incorrectly. either is fine I just wanted to check. teststestcase:
chezmoi config file:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for reporting this. To be honest With regards to The case of |
Beta Was this translation helpful? Give feedback.
Thanks for reporting this. To be honest
--autotemplate
is pretty sketchy as the fundamental problem of "reversing" the output and template variables to get the input template has no clearly-defined friendly solution. For example, if you have a template variable (e.g.machine_env
) is the single charactery
then--autotemplate
should replace everyy
character in the entire file with{{ .machine_env }}
, which is probably not what you want.With regards to
--autotemplate
implying--template
,--autotemplate
only makes the added file a template if an actual variable substitution was found. This is for when you usechezmoi add --autotemplate somedir/
, in which case it's desirable that only the f…