mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
bitbucket: minor cleanup
This commit is contained in:
parent
f6ff697d21
commit
2d0d3cfcee
1 changed files with 1 additions and 3 deletions
|
@ -8,10 +8,9 @@ BITBUCKET_URL = 'https://bitbucket.org/api/2.0/repositories/%s/commits/%s'
|
||||||
BITBUCKET_MAX_TAG = 'https://bitbucket.org/api/2.0/repositories/%s/refs/tags'
|
BITBUCKET_MAX_TAG = 'https://bitbucket.org/api/2.0/repositories/%s/refs/tags'
|
||||||
|
|
||||||
async def get_version(name, conf, *, cache, **kwargs):
|
async def get_version(name, conf, *, cache, **kwargs):
|
||||||
repo = conf.get('bitbucket')
|
repo = conf['bitbucket']
|
||||||
br = conf.get('branch', '')
|
br = conf.get('branch', '')
|
||||||
use_max_tag = conf.get('use_max_tag', False)
|
use_max_tag = conf.get('use_max_tag', False)
|
||||||
sort_version_key = sort_version_keys[conf.get("sort_version_key", "parse_version")]
|
|
||||||
|
|
||||||
if use_max_tag:
|
if use_max_tag:
|
||||||
url = BITBUCKET_MAX_TAG % repo
|
url = BITBUCKET_MAX_TAG % repo
|
||||||
|
@ -23,7 +22,6 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||||
data = await cache.get_json(url)
|
data = await cache.get_json(url)
|
||||||
|
|
||||||
if use_max_tag:
|
if use_max_tag:
|
||||||
data.sort(key=sort_version_key)
|
|
||||||
version = data
|
version = data
|
||||||
else:
|
else:
|
||||||
version = data['values'][0]['date'].split('T', 1)[0].replace('-', '')
|
version = data['values'][0]['date'].split('T', 1)[0].replace('-', '')
|
||||||
|
|
Loading…
Add table
Reference in a new issue