feat(mise): Support tools with custom mise params (e.g. tea)
Replace the hardcoded 'tea' special case in mise-tools with a generic
mechanism: a tool entry in tools.yaml/hosts.yaml can now be either a
plain string ("latest") or a map keyed by tool name whose value holds
mise params (version, url, asset_pattern, ...). This generalizes to
any future tool needing more than "latest", instead of requiring a
new hardcoded branch per tool.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,8 +19,9 @@ tools:
|
|||||||
- lazygit
|
- lazygit
|
||||||
- delta
|
- delta
|
||||||
- gh
|
- gh
|
||||||
- tea
|
- tea:
|
||||||
# tea = { version = "0.14.2", url = 'https://gitea.com/gitea/tea/releases/download/v{{- "{{" }} version {{ "}}" -}}/tea-{{- "{{" }} version {{ "}}" -}}-{{- "{{" }} os() {{ "}}" -}}-{{- "{{" }} arch(x64="amd64") {{ "}}" -}}.xz' }
|
version: "0.14.2"
|
||||||
|
url: "https://gitea.com/gitea/tea/releases/download/v{{ version }}/tea-{{ version }}-{{ os() }}-{{ arch(x64='amd64') }}.xz"
|
||||||
- jq
|
- jq
|
||||||
- yq
|
- yq
|
||||||
- shellcheck
|
- shellcheck
|
||||||
|
|||||||
@@ -18,9 +18,11 @@
|
|||||||
|
|
||||||
# Toolbox: {{ $toolboxName }}
|
# Toolbox: {{ $toolboxName }}
|
||||||
{{- range $tool := $toolsList }}
|
{{- range $tool := $toolsList }}
|
||||||
{{- /* Gestion fine du cas particulier de 'tea' mis en commentaire dans votre yaml */}}
|
{{- /* Un outil est soit une chaîne ("nom"), soit un objet { nom: {version, ...params mise} } */}}
|
||||||
{{- if eq $tool "tea" }}
|
{{- if kindIs "map" $tool }}
|
||||||
tea = { version = "0.14.2", url = "https://gitea.com/gitea/tea/releases/download/v{{`{{ version }}`}}/tea-{{`{{ version }}`}}-{{`{{ os() }}`}}-{{`{{ arch(x64='amd64') }}`}}.xz" }
|
{{- range $toolName, $params := $tool }}
|
||||||
|
{{ $toolName }} = { version = "{{ $params.version | default "latest" }}"{{ range $key, $value := omit $params "version" }}, {{ $key }} = "{{ $value }}"{{ end }} }
|
||||||
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
"{{ $tool }}" = "latest"
|
"{{ $tool }}" = "latest"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -34,10 +36,16 @@ tea = { version = "0.14.2", url = "https://gitea.com/gitea/tea/releases/download
|
|||||||
|
|
||||||
# Outils individuels
|
# Outils individuels
|
||||||
{{- range $tool := $currentUser.tools }}
|
{{- 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"
|
"{{ $tool }}" = "latest"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- else if $currentHost }}
|
{{- else if $currentHost }}
|
||||||
# Aucun profil trouvé dans hosts.yaml pour l'utilisateur {{ $username }} sur la machine : {{ $hostname }}
|
# Aucun profil trouvé dans hosts.yaml pour l'utilisateur {{ $username }} sur la machine : {{ $hostname }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
|
|||||||
Reference in New Issue
Block a user