Created
February 19, 2026 05:22
-
-
Save ryanwoodsmall/c6f5a403bd7789e30e4c0068f6914474 to your computer and use it in GitHub Desktop.
jq-get-latest-semver.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # given an array of semvers, get the latest. format must follow: | |
| # | |
| # [ "1.2.3", "0.0.1", "1.4.1", ..., "10.11.12" ] | |
| # | |
| # thank you tom | |
| # | |
| jq 'sort_by(split(".")|map(tonumber))|last' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment