Skip to content

Instantly share code, notes, and snippets.

@yfix
Forked from lukechilds/get_latest_release.sh
Created August 30, 2019 11:35
Show Gist options
  • Save yfix/74e803d0192e4d96ed08b5de69d64709 to your computer and use it in GitHub Desktop.
Save yfix/74e803d0192e4d96ed08b5de69d64709 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