summary refs log tree commit diff
path: root/pkgs/data/themes/adi1090x-plymouth-themes/update.sh
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-21 16:12:21 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-21 16:12:48 +0100
commit048a4cd441a59cbf89defb18bb45c9f0b4429b35 (patch)
treef8f5850ff05521ab82d65745894714a8796cbfb6 /pkgs/data/themes/adi1090x-plymouth-themes/update.sh
parent030c5028b07afcedce7c5956015c629486cc79d9 (diff)
parent4c2d05dd6435d449a3651a6dd314d9411b5f8146 (diff)
downloadnixpkgs-048a4cd441a59cbf89defb18bb45c9f0b4429b35.tar
nixpkgs-048a4cd441a59cbf89defb18bb45c9f0b4429b35.tar.gz
nixpkgs-048a4cd441a59cbf89defb18bb45c9f0b4429b35.tar.bz2
nixpkgs-048a4cd441a59cbf89defb18bb45c9f0b4429b35.tar.lz
nixpkgs-048a4cd441a59cbf89defb18bb45c9f0b4429b35.tar.xz
nixpkgs-048a4cd441a59cbf89defb18bb45c9f0b4429b35.tar.zst
nixpkgs-048a4cd441a59cbf89defb18bb45c9f0b4429b35.zip
Rebase onto e4ad989506ec7d71f7302cc3067abd82730a4beb HEAD rootfs
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/data/themes/adi1090x-plymouth-themes/update.sh')
-rwxr-xr-xpkgs/data/themes/adi1090x-plymouth-themes/update.sh22
1 files changed, 8 insertions, 14 deletions
diff --git a/pkgs/data/themes/adi1090x-plymouth-themes/update.sh b/pkgs/data/themes/adi1090x-plymouth-themes/update.sh
index 82eb9916553..0fe5db726b3 100755
--- a/pkgs/data/themes/adi1090x-plymouth-themes/update.sh
+++ b/pkgs/data/themes/adi1090x-plymouth-themes/update.sh
@@ -8,27 +8,21 @@ curl_args=( '--silent' )
 # optionally takes a GITHUB_TOKEN to overcome api rate limiting.
 if [ -n "$GITHUB_TOKEN" ]; then curl_args+=( --header "authorization: Bearer ${GITHUB_TOKEN}" ); fi
 
-# get last master ref
-curl_args+=( --url https://api.github.com/repos/adi1090x/files/commits/master )
-last_ref=$(curl "${curl_args[@]}" | jq -r '.sha' )
-
-unset curl_args[-1]
-curl_args+=( https://api.github.com/repos/adi1090x/files/git/trees/$last_ref\?recursive=1 )
-
-theme_archives=$(curl "${curl_args[@]}" \
-  | jq '.tree | map(select(.path| test("^plymouth-themes/themes/pack_.*tar.gz$"))| .path)')
+# get latest release assets
+curl_args+=( --url https://api.github.com/repos/adi1090x/plymouth-themes/releases/latest )
+theme_archives=$(curl "${curl_args[@]}" | jq -r '.assets' )
 
 dirname="$(dirname "$0")"
 
 printf '{\n' > "$dirname/shas.nix"
 
-repo_url="https://github.com/adi1090x/files/raw/$last_ref"
-
 while
   read -r file_path
 do
-    name=$(basename $file_path)
-    printf '  "%s" = {\n    url = "%s";\n    sha = "%s";\n  };\n' "${name%%.*}" "$repo_url/$file_path" "$(nix-prefetch-url "$repo_url/$file_path")" >>"$dirname/shas.nix"
-done < <(jq -r '.[]' <<<"$theme_archives")
+    name="$(basename $file_path)"
+    name="${name/.tar.gz/}"
+
+    printf '  "%s" = {\n    url = "%s";\n    sha = "%s";\n  };\n' "${name}" "$file_path" "$(nix-prefetch-url "$file_path")" >>"$dirname/shas.nix"
+done < <(jq -r '.[].browser_download_url' <<<"$theme_archives")
 
 printf '}\n' >> "$dirname/shas.nix"