-
I'm looking for some way to work with the situation where files are deleted from the source. Occasionally I move files around and it would be good if there were some way to clean up when that happens. For example, I had a file called Another use case is that I have a directory of scripts where I frequently refactor and delete files while working on them, and because chezmoi doesn't clean up that directory before updating, I'm left with outdated scripts that are deleted from the source but are left in the target. I could work around this by running a script from chezmoi to delete the target directory at the beginning of every run, but it would be nice if there were a way to tell chezmoi to always delete a specific target directory before applying it or otherwise keep it in sync. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
update: I found #1446 that says that chezmoi doesn't know about the history of files and suggests to use I'm updating my question to ask whether there is some built-in way to tell chezmoi to delete an entire directory before applying as a simple way of keeping a directory in sync. |
Beta Was this translation helpful? Give feedback.
-
I think the two things you're looking for are: |
Beta Was this translation helpful? Give feedback.
-
Thanks! Unfortunately |
Beta Was this translation helpful? Give feedback.
Thanks! Unfortunately
exact_
seems like it doesn't quite meet my needs because it seems to only work for files in the directory with that attribute and doesn't get applied to subfolders. In my case I'd have to apply theexact_
attribute to every subfolder which will be somewhat cumbersome.