diff --git a/home/.chezmoi.toml.tmpl b/home/.chezmoi.toml.tmpl index fcf24be..194e5c9 100644 --- a/home/.chezmoi.toml.tmpl +++ b/home/.chezmoi.toml.tmpl @@ -1,20 +1,15 @@ -chezmoi:template:missing-key=zero [data] email = {{ promptString "Git main email address " "" | quote }} {{- with promptInt "How many mbsync accounts would you generate " 0 -}}{{- $count := . | int }} -{{- if gt $count 0 -}} - -{{- range $i, $e := until $count }} -[[data.mbsync]] -name = {{ promptString "MbSync account name " | quote }} -mail = {{ promptString "MbSync account mail " | quote }} -user = {{ promptString "MbSync account user " | quote }} -host = {{ promptString "MbSync account host " | quote }} -{{- end }} - -{{ else }} - -[[data.mbsync]] - -{{- end }} + {{- if gt $count 0 -}} + {{- range $i, $e := until $count }} + [[data.mbsync]] + name = {{ promptString "MbSync account name " | quote }} + mail = {{ promptString "MbSync account mail " | quote }} + user = {{ promptString "MbSync account user " | quote }} + host = {{ promptString "MbSync account host " | quote }} + {{- end }} + {{- else -}} + [[data.mbsync]] + {{- end -}} {{- end }} diff --git a/home/dot_mbsyncrc.tmpl b/home/dot_mbsyncrc.tmpl index a05b479..9586a57 100644 --- a/home/dot_mbsyncrc.tmpl +++ b/home/dot_mbsyncrc.tmpl @@ -24,7 +24,6 @@ BufferLimit 100M # # ########################## -{{ if .mbsync }} {{ range $value := .mbsync }} # {{ $value.name }} @@ -116,4 +115,3 @@ Channel {{ $value.name }}-junk Channel {{ $value.name }}-archive {{ end }} -{{ end -}}