diff --git a/.chezmoidata/tools.yaml b/.chezmoidata/tools.yaml index 6db8b52..8204d13 100644 --- a/.chezmoidata/tools.yaml +++ b/.chezmoidata/tools.yaml @@ -19,8 +19,9 @@ tools: - lazygit - delta - gh - - tea - # tea = { version = "0.14.2", url = 'https://gitea.com/gitea/tea/releases/download/v{{- "{{" }} version {{ "}}" -}}/tea-{{- "{{" }} version {{ "}}" -}}-{{- "{{" }} os() {{ "}}" -}}-{{- "{{" }} arch(x64="amd64") {{ "}}" -}}.xz' } + - tea: + version: "0.14.2" + url: "https://gitea.com/gitea/tea/releases/download/v{{ version }}/tea-{{ version }}-{{ os() }}-{{ arch(x64='amd64') }}.xz" - jq - yq - shellcheck diff --git a/.chezmoitemplates/mise-tools b/.chezmoitemplates/mise-tools index 56ec530..08ec7a7 100644 --- a/.chezmoitemplates/mise-tools +++ b/.chezmoitemplates/mise-tools @@ -18,9 +18,11 @@ # Toolbox: {{ $toolboxName }} {{- range $tool := $toolsList }} - {{- /* Gestion fine du cas particulier de 'tea' mis en commentaire dans votre yaml */}} - {{- if eq $tool "tea" }} -tea = { version = "0.14.2", url = "https://gitea.com/gitea/tea/releases/download/v{{`{{ version }}`}}/tea-{{`{{ version }}`}}-{{`{{ os() }}`}}-{{`{{ arch(x64='amd64') }}`}}.xz" } + {{- /* Un outil est soit une chaƮne ("nom"), soit un objet { nom: {version, ...params mise} } */}} + {{- if kindIs "map" $tool }} + {{- range $toolName, $params := $tool }} +{{ $toolName }} = { version = "{{ $params.version | default "latest" }}"{{ range $key, $value := omit $params "version" }}, {{ $key }} = "{{ $value }}"{{ end }} } + {{- end }} {{- else }} "{{ $tool }}" = "latest" {{- end }} @@ -34,7 +36,13 @@ tea = { version = "0.14.2", url = "https://gitea.com/gitea/tea/releases/download # Outils individuels {{- range $tool := $currentUser.tools }} + {{- if kindIs "map" $tool }} + {{- range $toolName, $params := $tool }} +{{ $toolName }} = { version = "{{ $params.version | default "latest" }}"{{ range $key, $value := omit $params "version" }}, {{ $key }} = "{{ $value }}"{{ end }} } + {{- end }} + {{- else }} "{{ $tool }}" = "latest" + {{- end }} {{- end }} {{- end }} {{- end }}