diff --git a/home/.chezmoi.toml.tmpl b/home/.chezmoi.toml.tmpl index 8ed1677..5116b43 100644 --- a/home/.chezmoi.toml.tmpl +++ b/home/.chezmoi.toml.tmpl @@ -3,6 +3,10 @@ chezmoi:template:missing-key=zero email = {{ promptString "Git main email address " "" | quote }} {{- with promptInt "How many mbsync accounts would you generate " 0 -}}{{- $count := . | int }} {{- if gt $count 0 -}} + +[[data.mbsync]] +activate = true + {{- range $i, $e := until $count }} [[data.mbsync]] name = {{ promptString "MbSync account name " | quote }} @@ -14,7 +18,7 @@ host = {{ promptString "MbSync account host " | quote }} {{ else }} [[data.mbsync]] -active = {{ $count | quote }} +activate = false {{- end }} {{- end }} diff --git a/home/dot_mbsyncrc.tmpl b/home/dot_mbsyncrc.tmpl index 82aeeb4..7bb7f69 100644 --- a/home/dot_mbsyncrc.tmpl +++ b/home/dot_mbsyncrc.tmpl @@ -24,8 +24,8 @@ BufferLimit 100M # # ########################## -{{ if not .mbsync.count }} -{{ range $value := .mbsync }} +{{ if .mbsync.activate }} +{{ range $value := .mbsync[1:] }} # {{ $value.name }} #-------------------------