Closed devinnasar closed 1 year ago
symlink_com.googlecode.iterm2.plist.tmpl
and com.googlecode.iterm2.plist
will both evaluate to com.googlecode.iterm2.plist
. chezmoi is confused here because it sees the ~/.config/iterm2_profile/com.googlecode.iterm2.plist
target as both a symlink to a file and a regular file.
You can rename ~/.local/share/chezmoi/dot_config/iterm2_profile/com.googlecode.iterm2.plist
to, for example, config.plist
, then add it to .chezmoiignore
and update the path in the symlink.
@bradenhilton So your solution results in both config.plist and com.googlecode.iterm2.plist being rendered to ~/.config/iterm2_profile. My complaint is that .chezmoiignore is not respecting the files added to it.
Your .chezmoiignore
isn't matching because it has com.googlecode.iterm2.plist
at the root of the target directory.
Actually, now that I look at it more, the rest of the paths in your .chezmoiignore
are incorrect.
.chezmoiignore
matches target paths, not source paths.
To ignore config.plist
, which will be used in the symlink, you need to ignore .config/iterm2_profile/config.plist
.
.chezmoiignore
:
# -*-mode:gitignore-*- vim:ft=gitignore
# ...
*.gz
LICENSE
README.md
.config/iterm/config.plist
# Ignore non-macOS files.
{{ if ne .chezmoi.os "darwin" -}}
.config/iterm
.Brewfile
{{- end }}
# Ignore non-Windows files.
{{ if ne .chezmoi.os "windows" -}}
.config/windows_terminal
{{- end }}
$ tree .local/share/chezmoi/dot_config/iterm
.local/share/chezmoi/dot_config/iterm
├── config.plist
└── symlink_com.googlecode.iterm2.plist.tmpl
$ tree .config/iterm
.config/iterm
└── com.googlecode.iterm2.plist -> ~/.local/share/chezmoi/dot_config/iterm/config.plist
Please re-open or comment if needed.
What exactly are you trying to do?
I have a file contained in my .chezmoiignore file that is still being copied from my chezmoi source directory to the target directory. I am trying to accomplish the iterm2 setup referenced here: https://github.com/renemarc/dotfiles/tree/master/dot_config/iterm. Currently what's happening is that .chezmoiignore is failing to ignore com.googlecode.iterm2.plist, so it attempts to copy the file directly and create a symlink to it at the same path and prevents
chezmoi apply -v
from running correctlyDescribe in as much detail as possible.
~/.local/share/chezmoi/.chezmoiignore:
Source directory:
Errors:
The template is trying to render a symlink file to ~/.config/iterm2_profile/com.googlecode.iterm2.plist pointing back to the file located in my chezmoi repo at ~/.local/share/chezmoi/dot_config/iterm2_profile/com.googlecode.iterm2.plist. But chezmoi is also trying to copy the file to the same path that the symlink is rendering to. My expectation is that because I've specified
com.googlecode.iterm2.plist
in .chezmoiignore, that chezmoi will not copy the file and then generate the symlink instead.What is wrong with my .chezmoiignore file for this not to be happening? The ultimate point of this is for iterm2 to be configured to point at the symlink so that changes set in iterm2's gui will easily find their way back to the chezmoi repo. HOWEVER, it's more concerning to me that .chezmoiignore just doesn't work the way that I'm expecting.
What have you tried so far?
Many many combinations of paths in .chezmoiignore, changing my template file symlink path. I've been able to get it to the point where both com.googlecode.iterm2.plist (symlink) and the actual file with a separate filename are BOTH being copied into the target directory, which is still not what I want.
Where else have you checked for solutions?
Output of any commands you've tried with
--verbose
flagsee above
Output of
chezmoi doctor
Additional context
Add any other context about the problem here.