From c34f7ae6312da5a401b47e035e7daf92d436b7dd Mon Sep 17 00:00:00 2001
From: "Lockszmith (wsl@Sygin)" <code@lksz.me>
Date: Sat, 12 Apr 2025 09:57:23 -0400
Subject: [PATCH] fix archive_type bug introduced earlier

---
 _src.posix/.chezmoiexternal.yaml.tmpl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/_src.posix/.chezmoiexternal.yaml.tmpl b/_src.posix/.chezmoiexternal.yaml.tmpl
index 9f8ca5e..7423f1b 100644
--- a/_src.posix/.chezmoiexternal.yaml.tmpl
+++ b/_src.posix/.chezmoiexternal.yaml.tmpl
@@ -22,7 +22,8 @@
 {{- if (env "CZ_EXTR") -}}
 {{/* Initialize template variables */}}
 {{- $myArch := "" -}}
-{{- $archive_type := or (get (dict "linux" "tgz") .chezmoi.os) "zip" -}}
+{{- $archive_type := or (get (dict "linux" "tar.gz") .chezmoi.os) "zip" -}}
+{{- $archive_type_short := or (get (dict "tar.gz" "tgz") $archive_type) $archive_type -}}
 {{- $path_prefix := "" -}}
 {{- $externals := dict -}}
 
@@ -94,7 +95,7 @@
 {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
 {{-   $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
         "type" "archive-file"
-        "url" (printf "https://github.com/%s/releases/download/%s/%s-%s.full.%s" $repo $version $app_name $myArch $archive_type)
+        "url" (printf "https://github.com/%s/releases/download/%s/%s-%s.full.%s" $repo $version $app_name $myArch $archive_type_short)
         "path" $app_name
         "executable" true
         "refreshPeriod" $defaultRefresh