# chezmoi:template:left-delimiter=#{{ #{{- /* vim: set filetype=jq: */ -}} #{{- if lookPath "jq" -}} 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") ) "; #{{- end }}