Skip to content

Instantly share code, notes, and snippets.

@cideM
Created March 19, 2021 09:25
Show Gist options
  • Select an option

  • Save cideM/06b309a2f9cda27972458a9df2482c68 to your computer and use it in GitHub Desktop.

Select an option

Save cideM/06b309a2f9cda27972458a9df2482c68 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