Skip to content

Commit fe9af7d

Browse files
committed
Starship: Convert to modify-template to avoid overwrite prompts
A second chezmoi layer modifies these files after this layer writes them, causing chezmoi to detect a conflict and prompt on the next apply. Using modify-template makes chezmoi treat the files as transformations rather than managed files, avoiding the prompt.
1 parent a556591 commit fe9af7d

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- /*
2+
Modify-template: chezmoi never prompts about overwriting
3+
starship-ascii-prompt.toml. A second chezmoi layer applies modify_
4+
scripts on top to inject theme values, so the on-disk content always
5+
differs from what this layer writes. We ignore .chezmoi.stdin and
6+
always regenerate the full content.
7+
*/ -}}
8+
# chezmoi:modify-template
9+
# WARNING: This file is generated by chezmoi. Local changes WILL be overwritten.
10+
11+
{{ template "starship.toml.tmpl" (merge (dict "ascii_prompt" true) .) -}}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- /*
2+
Modify-template: chezmoi never prompts about overwriting starship.toml.
3+
A second chezmoi layer applies modify_ scripts on top to inject theme
4+
values, so the on-disk content always differs from what this layer writes.
5+
We ignore .chezmoi.stdin and always regenerate the full content.
6+
*/ -}}
7+
# chezmoi:modify-template
8+
# WARNING: This file is generated by chezmoi. Local changes WILL be overwritten.
9+
10+
{{ template "starship.toml.tmpl" (merge (dict "ascii_prompt" false) .) -}}

home/dot_config/starship-ascii-prompt.toml.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

home/dot_config/starship.toml.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)