Closed BoltsJ closed 1 year ago
What you’re describing is the default behavior without the empty_
and create_
prefixes, so simply remove the create prefix!
The document explains what `create` does: Ensure that the file exists, and create it with contents if it does not
Right, but the problem is that create_
is also creating files with no contents when empty_
is not specified.
In my understanding, create_
applies the source contents only when the target file does not exist, initializing the file. Whereas empty_
always applies the source contents, managing the content of the file.
It’s not possible to use create_
and empty_
together.
Then what is the point of empty_
if the source file is always applied regardless of whether it's empty?
Describe the bug
When a
create_
source file or template would result in an empty file, the files is created regardless of whether the file is alsoempty_
.To reproduce
For a non-tempate: In the source directory
An empty
a
file will be created.For a template: In the source directory:
An empty
b
file will be createdExpected behavior
Files with
create_
but notempty_
do not create empty filesOutput of command with the
--verbose
flagOutput of
chezmoi doctor
Additional context
Add any other context about the problem here.