Skip to content

Instantly share code, notes, and snippets.

@asimzeeshan
Forked from lukechilds/get_latest_release.sh
Created November 30, 2020 13:20
Show Gist options
  • Select an option

  • Save asimzeeshan/4284e13d3d519f16e2c7e028399b8941 to your computer and use it in GitHub Desktop.

Select an option

Save asimzeeshan/4284e13d3d519f16e2c7e028399b8941 to your computer and use it in GitHub Desktop.

Revisions

  1. @lukechilds lukechilds created this gist Aug 9, 2016.
    10 changes: 10 additions & 0 deletions get_latest_release.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@

    get_latest_release() {
    curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
    grep '"tag_name":' | # Get tag line
    sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
    }

    # Usage
    # $ get_latest_release "creationix/nvm"
    # v0.31.4