Return only latest version when checking releases

This commit is contained in:
Fabian Mastenbroek 2021-02-24 10:53:13 +01:00
parent d8b33b61aa
commit 601b62139a
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85

View file

@ -5,7 +5,7 @@ set -o pipefail
MAJOR=$(echo $1 | sed -e "s/^v//" -e "s/\.[^.]*$//")
CURRENT=$(scripts/version.sh -L)
NEW=$(curl -s https://www.kernel.org/releases.json | jq -r ".releases[]|select(.version | startswith(\"$MAJOR\")) | .version")
NEW=$(curl -s https://www.kernel.org/releases.json | jq -r ".releases|sort_by(-.released.timestamp)|map(select(.version | startswith(\"$MAJOR\")))|first|.version")
if [[ "$(scripts/version.sh -p)" = "0" ]]; then
[[ "$(scripts/version.sh -n)" = "$NEW" ]] || echo $NEW