Skip to content

Instantly share code, notes, and snippets.

@cideM
Created March 19, 2021 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cideM/0e35d6b5d8c859e3017fefbed63846c1 to your computer and use it in GitHub Desktop.
Save cideM/0e35d6b5d8c859e3017fefbed63846c1 to your computer and use it in GitHub Desktop.
echo '[{"name":"v1.22.10","zipball_url":"https://api.github.com/repos/yarnpkg/yarn/zipball/v1.22.10","tarball_url":"https://api.github.com/repos/yarnpkg/yarn/tarball/v1.22.10","commit":{"sha":"785cda8020aa5f513d6f60b8349bca8dab9dd79b","url":"https://api.github.com/repos/yarnpkg/yarn/commits/785cda8020aa5f513d6f60b8349bca8dab9dd79b"},"node_id":"MDM6UmVmNDk5NzA2NDI6cmVmcy90YWdzL3YxLjIyLjEw"}]' | tr ',' '\n' | awk -F'":"' '{ version; gsub(/"/, "", $2); if ($1 ~ /name/ ) { version = $2; } if ($1 ~ /tarball/) { gsub(/v/, "", version); print version, $2; } }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment