Skip to content

Instantly share code, notes, and snippets.

@sparkstar
Created January 21, 2019 09:36
Show Gist options
  • Save sparkstar/0af9ac8c820e33f590ea1b692ec82aba to your computer and use it in GitHub Desktop.
Save sparkstar/0af9ac8c820e33f590ea1b692ec82aba to your computer and use it in GitHub Desktop.
get latest releases version(tag) from github repository
#!/bin/sh
# get latest releases version(tag) from github repository
# $ ./latest.sh neovim/neovim
# v0.3.4
# $ ./latest.sh tus/tusd
# 0.11.0
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep "tag_name" | sed -E 's/.*\:\s\"(.*)\",*/\1/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment