Skip to content

Instantly share code, notes, and snippets.

@maboloshi
Forked from lukechilds/get_latest_release.sh
Last active February 17, 2019 12:38
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 maboloshi/1050dae1609c3bb9cd746a2fb6893cf7 to your computer and use it in GitHub Desktop.
Save maboloshi/1050dae1609c3bb9cd746a2fb6893cf7 to your computer and use it in GitHub Desktop.
[Shell - Get latest release number from repository on GitHub ] 从GitHub上的存储库获取最新版本号, 不适用不规范发布 #github #shell
get_latest_release_number() {
curl --silent "https://github.com/$1/releases/latest" | sed 's#.*tag/\(.*\)".*#\1#'
}
# Usage
# $ get_latest_release_number "creationix/nvm"
# v0.34.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment