diff options
Diffstat (limited to 'pkgs/data/themes/adi1090x-plymouth-themes/update.sh')
-rwxr-xr-x | pkgs/data/themes/adi1090x-plymouth-themes/update.sh | 22 |
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 82eb9916553a..0fe5db726b3f 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" |