-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.chezmoi.toml.tmpl
37 lines (30 loc) · 1.11 KB
/
.chezmoi.toml.tmpl
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
31
32
33
34
35
36
37
{{ $email := env "DOTFILES_EMAIL" }}
{{ if (and stdinIsATTY (empty $email)) }}
{{ $email = promptString "email" }}
{{ end }}
{{ if empty $email }}
{{ writeToStdout "Missing e-mail - either set DOTFILES_EMAIL or use the prompt\n" }}
{{ exit 1 }}
{{ end }}
{{ $sharedServer := true }}
{{ if empty (env "DOTFILES_SHARED_SERVER") | not }}
{{ $sharedServer = not (eq (env "DOTFILES_SHARED_SERVER") "n" "no" "false" "f" "0") }}
{{ else if stdinIsATTY }}
{{ $sharedServer = promptBool "shared server" }}
{{ else }}
{{ writeToStdout "Missing gpg signing key - either set DOTFILES_SHARED_SERVER or use the prompt\n" }}
{{ exit 1 }}
{{ end }}
{{ $gpgCommitSigningKey := "" }}
{{ if not $sharedServer }}
{{ $gpgCommitSigningKey = env "DOTFILES_GPG_SIGNING_KEY" }}
{{ if (and stdinIsATTY (empty $gpgCommitSigningKey)) }}
{{ $gpgCommitSigningKey = promptString "gpg commmit signing key" }}
{{ end }}
{{ end }}
[data]
email = {{ $email | quote }}
shared_server = {{ $sharedServer }}
{{ if not $sharedServer }}
gpg_commit_signing_key = {{ $gpgCommitSigningKey | quote }}
{{ end }}