We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After digging into #2940, #2942, and #2943, I am still encountering issues with the .chezmoi.config template variables being inaccessible.
.chezmoi.config
It seems that not all variables are accessible, such as identity from age.
identity
age
.chezmoi.toml.tmpl:
.chezmoi.toml.tmpl
{{- $identity := promptStringOnce . ".chezmoi.config.age.identity" "Encryption key path (age)" -}} encryption = "age" [age] identity = {{ $identity | quote }} symmetric = true
chezmoi init output:
chezmoi init
chezmoi: template: chezmoi.toml:11:17: executing "chezmoi.toml" at <promptStringOnce . ".chezmoi.config.age.identity" "Encryption key path (age)">: error calling promptStringOnce: empty path element at index 0
The error occurs even if I pre-populate ~/.config/chezmoi/chezmoi.toml:
~/.config/chezmoi/chezmoi.toml
encryption = "age" [age] identity = "~/some/path" symmetric = true
$ chezmoi execute-template '{{ .chezmoi.config.age.identity }}' ~/some/path
Even the chezmoi data command does not return the values:
chezmoi data
"age": { "args": null, "command": "age", "identities": null, "identity": {}, "passphrase": false, "recipient": "", "recipients": null, "recipientsFile": {}, "recipientsFiles": null, "suffix": ".age", "symmetric": true, "useBuiltin": false }
$ chezmoi --version chezmoi version v2.46.1, built at 2024-02-12T09:19:56Z
The text was updated successfully, but these errors were encountered:
Re:
{{- $identity := promptStringOnce . ".chezmoi.config.age.identity" "Encryption key path (age)" -}}
I think this should be
{{- $identity := promptStringOnce . "chezmoi.config.age.identity" "Encryption key path (age)" -}}
i.e. remove the leading .. The second argument to promptStringOnce is a path to a field in an object, not a template expression.
.
promptStringOnce
Sorry, something went wrong.
Sorry, there is also a bug in chezmoi. It is the same bug as #3593.
Successfully merging a pull request may close this issue.
Describe the bug
After digging into #2940, #2942, and #2943, I am still encountering issues with the
.chezmoi.config
template variables being inaccessible.It seems that not all variables are accessible, such as
identity
fromage
.To reproduce
.chezmoi.toml.tmpl
:chezmoi init
output:The error occurs even if I pre-populate
~/.config/chezmoi/chezmoi.toml
:Expected behavior
Additional context
Even the
chezmoi data
command does not return the values:The text was updated successfully, but these errors were encountered: