Skip to content
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

Autotemplate does not work with symlinks #864

Closed
Legion2 opened this issue Aug 20, 2020 · 2 comments
Closed

Autotemplate does not work with symlinks #864

Legion2 opened this issue Aug 20, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@Legion2
Copy link
Contributor

Legion2 commented Aug 20, 2020

Describe the bug

I have multiple ssh keys on different machines and each of the machines have a different default key. So I want to symlink the default ssh key (id_rsa and id_rsa.pub) to the default key of that machine. I already created a data entry for the default key name called defaultSshKey. I created the symlinks and now want to add them to my dotfiles with chezmoi add --autotemplate .ssh\id_rsa. But the result of this is not a template symlink which uses the value of defaultSshKey.

To reproduce

See description.

Expected behavior

A symlink template is created and uses the defaultSshKey value.

Output of command with --verbose

$ chezmoi add --autotemplate .ssh\id_rsa --verbose

Output of chezmoi doctor

$ chezmoi doctor
     ok: version 1.8.3, commit 6d2be34cda3461ddf1211f98fdb10c00a4e18d67, built at 2020-06-25T16:18:17Z, built by goreleaser
     ok: runtime.GOOS windows, runtime.GOARCH amd64
  ERROR: C:\Users\Leon\.local\share\chezmoi (source directory, perm 777)
     ok: C:\Users\Leon (destination directory, perm 777)
     ok: C:\Users\Leon\.config\chezmoi\chezmoi.yaml (configuration file)
     ok: C:\WINDOWS\system32\cmd.exe (shell)
  ERROR: vi (editor, not found)
warning: vimdiff (merge command, not found)
     ok: C:\Program Files\Git\cmd\git.exe (source VCS command, version 2.28.0)
     ok: C:\Program Files (x86)\GnuPG\bin\gpg.exe (GnuPG, version 2.2.21)
warning: op (1Password CLI, not found)
warning: bw (Bitwarden CLI, not found)
warning: gopass (gopass CLI, not found)
warning: keepassxc-cli (KeePassXC CLI, not found)
warning: lpass (LastPass CLI, not found)
warning: pass (pass CLI, not found)
warning: vault (Vault CLI, not found)

Additional context

I'm using windows 10

@Legion2
Copy link
Contributor Author

Legion2 commented Aug 20, 2020

Seems like the template data names are converted to lowercase. I have to use defaultsshkey in my templates even though I have data: defaultSshKey: in my config.

@zb140
Copy link
Collaborator

zb140 commented Aug 21, 2020

That's because of an issue in Viper, which is used for reading the config file. See #463 for all the details.

@twpayne twpayne added the enhancement New feature or request label Aug 22, 2020
@twpayne twpayne added this to the v2.0.0 milestone Aug 22, 2020
@twpayne twpayne closed this as completed Jan 17, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants