Skip to content

found no way to manage Log files / Dynamic Files (whose content are changing continuously ) #2969

Answered by halostatue
nitrogenxx asked this question in Q&A
Discussion options

You must be logged in to vote

I have attempted to implement a solution where, if the file exists, it is ignored, and if it does not exist, it is added to the specified location. However, I am encountering an issue with the fileExists function not being defined. Here's the code I tried:

{{if fileExists ".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml" }}
         .config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml 
{{end}}

The function you’re looking for is stat, which returns null if the file does not exist.

{{ if stat (joinPath .chezmoi.homeDir ".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml") }}
.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
{{ end }}

the only content of the file in which i only w…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@nitrogenxx
Comment options

Comment options

You must be logged in to vote
2 replies
@nitrogenxx
Comment options

@halostatue
Comment options

Answer selected by nitrogenxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants