-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having issues with getting values from chezmoi
in templates
#1108
Comments
When a template gets executed with You should be able to fix it by explicitly passing
I haven't actually tested this myself because when I tried I got some very weird errors trying to add a new template in |
Thanks for the help! I'm away from the machine with the error right now, so I'll be keeping this open till I confirm that everything works. I was following https://www.chezmoi.io/docs/how-to/#handle-different-file-locations-on-different-systems-with-the-same-contents, which does not include the explicit passing of |
@zb140 that seems to have done the trick. Thanks again! |
The "different files locations on different systems" guide didn't pass data to the template file, which can result in errors. See #1108 for an example of this problem.
What exactly are you trying to do?
Trying to write a template for a configuration file which has different locations on different systems. I have a file in
.chezmoitemplates
; let's call itfile.toml
. Here are the file's contents (I've removed all unnecessary details):I then have the actual config file with the following content:
The issue is that
{{ chezmoi.homeDir }}
doesn't work, giving me the following error:What have you tried so far?
Running
chezmoi execute-template "{{ .chezmoi.homeDir }}"
works just fine.Where else have you checked for solutions?
Output of any commands you've tried with
--verbose
Output of
chezmoi doctor
Additional context
None.
The text was updated successfully, but these errors were encountered: