You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
716 B
Cheetah
30 lines
716 B
Cheetah
2 years ago
|
{{ if lookPath "jq" -}}
|
||
3 years ago
|
def by_time: sort_by(.created_at) | reverse;
|
||
|
|
||
|
def asset($os; $arch):
|
||
|
.assets[]
|
||
|
| select(.name | test($os))
|
||
|
| select(.name | test($arch))
|
||
|
;
|
||
|
|
||
|
def latest: by_time | limit(1; .[]);
|
||
|
def latest_body: latest | .body;
|
||
|
def latest_version: latest | .tag_name;
|
||
|
|
||
|
def latest_asset($os; $arch): latest | asset($os; $arch);
|
||
|
def latest_download($os; $arch): latest_asset($os; $arch) | .browser_download_url;
|
||
|
def latest_type($os; $arch): latest_asset($os; $arch) | .content_type;
|
||
|
|
||
|
def summary($os; $arch):
|
||
|
"\((.name | select(. != "")) // .tag_name // .id)
|
||
|
created at: \(.created_at)
|
||
|
assets
|
||
|
\(
|
||
|
[ asset($os; $arch)
|
||
|
| .name
|
||
|
| " → \(.)"
|
||
|
] | join("\n")
|
||
|
)
|
||
|
";
|
||
2 years ago
|
{{- end }}
|