Skip to content

Commit

Permalink
Sorting releases and taking latest (#4703)
Browse files Browse the repository at this point in the history
  • Loading branch information
shilovmaksim authored Dec 9, 2021
1 parent 8a71231 commit 5f872f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion images/linux/scripts/installers/kotlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ source $HELPER_SCRIPTS/install.sh

KOTLIN_ROOT="/usr/share"

URL=$(curl -s https://api.github.com/repos/JetBrains/kotlin/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kotlin-compiler"))')
kotlinReleasesUrl="https://api.github.com/repos/JetBrains/kotlin/releases"
latestRelease=$(curl -s $kotlinReleasesUrl | jq -r 'map(select(.prerelease == false)) | sort_by(.target_commitish)[-1]')
URL=$(echo $latestRelease | jq -r '.assets[].browser_download_url | select(contains("kotlin-compiler"))')
download_with_retries $URL "/tmp"

unzip -qq /tmp/kotlin-compiler*.zip -d $KOTLIN_ROOT
Expand Down

0 comments on commit 5f872f7

Please sign in to comment.