Skip to content

Instantly share code, notes, and snippets.

View corvax19's full-sized avatar

romans.krjukovs corvax19

  • Riga, Latvia
  • 01:28 (UTC +02:00)
View GitHub Profile
@corvax19
corvax19 / get_latest_release.sh
Created January 30, 2022 10:31 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
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