GetLatestTfNamesValsRelease

nicolaw 10th December 2019 at 5:22pm
TechnicalNotes

https://github.com/geospock/tf-named-vals/releases

$ curl -sSL $(curl -s "https://api.github.com/repos/geospock/tf-named-vals/releases" | jq -r --arg system "$(uname -s)" 'sort_by(.tag_name|scan("[0-9\\.]*")|split(".")|map(tonumber))|(.[-1].tag_name) as $max|.[]|(select(.tag_name==$max))|.assets[]|select(.name|ascii_downcase|contains($system|ascii_downcase))|.browser_download_url') | tar -zxf -

$ ls -1rt
tf-named-vals-darwin-amd64*