-
Notifications
You must be signed in to change notification settings - Fork 498
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
Custom data fields appear as all lowercase strings #463
Comments
Thanks for reporting the issue. I did some digging and this is actually a bug/feature in the Apparently a fix is in and should be released soon. If that doesn't happen then I'll remove the dependency on Viper - chezmoi uses so little of the Viper's functionality that it's not really worth using the package anyway. |
Awesome, thanks for looking into it, hope they fix it soon! |
So viper 1.5.0 got released, but the bug was not actually fixed. See this comment. I tried building chezmoi with viper 1.5.0 and the lowercasing was still present. |
Thanks for following up on this! Guess we'll have to wait a bit more |
I just encountered this behavior. I'm glad this issue was reported and that it's being tracked by the chezmoi team. It's worth noting that #593 was closed and that it looks like we're waiting for viper team to release 2.0. |
I ran into this issue today. It's been over a year since the last comment. Is it worth removing Viper as a dependency, which was proposed earlier in the thread? |
Sadly it looks like it's going to be a while before Viper implements this - there was a survey for interest about 13 months ago, but still many open issues. Fixing this in chezmoi will take some time as it will take several steps:
Given that the current state does work, even though it's a little annoying, and fixing this will require significant effort (replacing Viper), I think the |
I'm starting to use chezmoi so I'm interested in helping. No promises, but I'd like to help make things better. |
Hi, I'm new to chezmoi and started to look into templates. I've spent quite some time to figure out why I could not get custom variables in the `data` section of the config to work until I realized that I've stumbled upon twpayne#463. I propose to add a hint or disclaimer to the documentation here to make it easier for newcomers to spot this pitfall (and avoid it). Please let me know if I need to change or update anything.
Hi, I'm new to chezmoi and started to look into templates. I've spent quite some time to figure out why I could not get custom variables in the `data` section of the config to work until I realized that I've stumbled upon #463. I propose to add a hint or disclaimer to the documentation here to make it easier for newcomers to spot this pitfall (and avoid it). Please let me know if I need to change or update anything.
Troubleshooting
chezmoi doctor
and fixed as many issues as possible and retried my command.Failure to follow the troubleshooting steps (and to report information requested below), may make it difficult to provide the proper support required. Furthermore, your issue may be closed without reply, if the instructions were not properly followed.
Description of issue
I added this block in my
.chezmoi.toml.tmpl
:The file that got generated is this one:
But trying to use those variables doesn't work, unless I write them down all in lowercase, i.e
islinux
.A quick note is that it looks like my system (macOS Mojave, 10.14.6) has a non case-sensitive file system, which might or might not be the cause of this. But I would like to not have to change that setting because this machine is my main programming device, and I am afraid changing that setting might cause other issues. Also, all other
chezMoi
data strings are cased correctly (likechezmoi.fullHostname
)EDIT: Looks like the same thing happens in WSL (Linux subsystem on Windows), so might not be related to the filesystem being case-sensitive.
I could also just use the
.chezmoi.os
data directly, but those data fields help me keep things more readable and avoid typos better.Also, just wanted to say I really appreciate this software, it really helps me manage my dotfiles much better!
Command that failed
Output of command with
--verbose
Output of
chezmoi doctor
Output of
chezmoi --version
The text was updated successfully, but these errors were encountered: