Closed MRDGH2821 closed 2 months ago
This is an issue with the whitespace control characters:
As is, on Windows:
❯ Get-Content .\3942.toml.tmpl | chezmoi execute-template --init
[data]
email = "Email address"
username = "MRDGH2821"
profile = "personal"
[edit]
command = "Editor (code/zed)"
args = ["--wait"]
[keepassxc]
database = "KeepassXC DB Path"
encryption = "gpg"
[gpg]
recipient = "D30D1B600CF5CDEE9EC2D7DBDAD1E1E272A1FA73"
[hooks.read-source-state.pre]
command = "powershell"
args = [".local/share/chezmoi/.chezmoiscripts/.install-password-manager.ps1"]
If I change the if
to {{- if eq .chezmoi.os "linux" }}
(while still on Windows):
❯ Get-Content .\3942.toml.tmpl | chezmoi execute-template --init
[data]
email = "Email address"
username = "MRDGH2821"
profile = "personal"
[edit]
command = "Editor (code/zed)"
args = ["--wait"]
[keepassxc]
database = "KeepassXC DB Path"
encryption = "gpg"
[gpg]
recipient = "D30D1B600CF5CDEE9EC2D7DBDAD1E1E272A1FA73"
[hooks.read-source-state.pre]command = ".local/share/chezmoi/.chezmoiscripts/.install-password-manager.sh"
In this situation, I would recommend
{{ if ... -}}
...
{{- else -}}
...
{{- end }}
or just removing them.
Thank you very much! That works as expected
What exactly are you trying to do?
Trying to initialise my dotfiles
What have you tried so far?
Checked indentation of toml template, it is valid. Checked toml templates of other users, used their indentation settings, still does not work.
Where else have you checked for solutions?
Output of any commands you've tried with
--verbose
flagOutput of
chezmoi doctor
Additional context