From 7ae27ecc783be75b1b6ce43b33890cfdd0bb5ca6 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Mon, 4 Mar 2024 16:20:30 +0100 Subject: [PATCH] Up. --- home/.chezmoi.toml.tmpl | 27 +++++++++++---------------- home/dot_mbsyncrc.tmpl | 2 -- 2 files changed, 11 insertions(+), 18 deletions(-) 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 -}}