-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.chezmoi.yaml.tmpl
More file actions
30 lines (25 loc) · 956 Bytes
/
.chezmoi.yaml.tmpl
File metadata and controls
30 lines (25 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{{- /* Checks if running interactively, which is not the case for GitHub Codespaces */ -}}
{{- $interactive := stdinIsATTY -}}
{{- /* Initializes the name variable with a default value */ -}}
{{- $name := "Your Name" -}}
{{- /* If name was previously set, reuses it */ -}}
{{- if hasKey . "name" -}}
{{- $name = .name -}}
{{- /* Otherwise, if running interactively, prompts for a name */ -}}
{{- else if $interactive -}}
{{- $name = promptString "name" $name -}}
{{- end -}}
{{- /* Does the same for the email */ -}}
{{- $email := "your@email.com" -}}
{{- if hasKey . "email" -}}
{{- $email = .email -}}
{{- else if $interactive -}}
{{- $email = promptString "email" $email -}}
{{- end -}}
{{- if $interactive -}}
{{- writeToStdout "💡 Tip: you can re-enter your name and email with `chezmoi init --data=false`.\n" -}}
{{- end -}}
sourceDir: {{ .chezmoi.sourceDir | quote }}
data:
name: {{ $name | quote }}
email: {{ $email | quote }}