diff options
author | Semyon Maryasin | 2019-03-23 02:19:09 +0300 |
---|---|---|
committer | Semyon Maryasin | 2019-03-23 02:19:59 +0300 |
commit | 3777fc115f6dec26384258728066f6c1b728e3c8 (patch) | |
tree | 4dab7b858824d83d57cc74ef88354c11bda58af8 | |
parent | d7cfcf710302c83437d00c6a8c69c78adae408b8 (diff) | |
download | aur-3777fc115f6dec26384258728066f6c1b728e3c8.tar.gz |
Use Github API for latest version detection
Rather than messing with HTML
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 9 |
2 files changed, 7 insertions, 4 deletions
@@ -10,7 +10,7 @@ pkgbase = zeit-now-bin provides = zeit-now conflicts = nodejs-now options = !strip - source = https://github.com/zeit/now-cli/releases/latest + source = https://api.github.com/repos/zeit/now-cli/releases/latest md5sums = SKIP pkgname = zeit-now-bin @@ -26,7 +26,7 @@ options=("!strip") install= changelog= # Actually this is just an information about the latest version. -source=("https://github.com/zeit/now-cli/releases/latest") +source=("https://api.github.com/repos/zeit/now-cli/releases/latest") noextract=() md5sums=('SKIP') validpgpkeys=() @@ -34,8 +34,11 @@ validpgpkeys=() pkgver() { # Could not find a way to check version *before* downloading sources, # so we fetch version information instead of sources - # and then download the real binary in build() - cat latest | grep -o 'tag/[^"]*' | sed 's:tag/::' + # and then download the real binary in build(). + # The data in `latest` is a pretty-printed JSON. + # We could parse it using `jq` package, but let's not introduce extra dependencies + # for such trivial case. + cat latest | grep -Po '(?<="tag_name":)\s*"[0-9.]*"' | tr -d '" ' } build() { |