Skip to content

Instantly share code, notes, and snippets.

@liusheng
Created November 28, 2018 08:40
Show Gist options
  • Save liusheng/a1e4279bacd46b6154983ce6103e8984 to your computer and use it in GitHub Desktop.
Save liusheng/a1e4279bacd46b6154983ce6103e8984 to your computer and use it in GitHub Desktop.
query the latest released version tag of a repo
#!/bin/bash
#way 1:
curl --silent "https://api.github.com/repos/docker/machine/releases/latest" | python -c "import sys, json; print json.load(sys.stdin)['tag_name']"
# way 2:
apt install jq -y
curl --silent "https://api.github.com/repos/docker/machine/releases/latest" | jq -r .tag_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment