openresty / opm

OpenResty Package Manager
https://opm.openresty.org/
461 stars 75 forks source link

How can I get the latest version of a package in CLI? #72

Open ktalebian opened 5 years ago

ktalebian commented 5 years ago

Running opm search durpina gives

➜ opm search durpina   
slact/durpina                                     Dynamic Upstream Reversy Proxying wIth Nice API

Let's say I have this package installed, and I'm just interested to know what is latest or all available versions of this package. How do I get that information via command-line?

ktalebian commented 5 years ago

Alright found the answer: https://opm.openresty.org/api/pkg/exists?account=slact&name=durpina

ktalebian commented 5 years ago

Opening this again, because the API is not returning the latest, but rather a version found. For example https://opm.openresty.org/api/pkg/exists?account=openresty&name=lua-resty-lrucache; 0.04 is not the latest version

ktalebian commented 5 years ago

For now, I'm recursively using https://opm.openresty.org/api/pkg/exists?account={}&name={}&op=gt&version={} endpoint because this will always show one version greater than the given version.