Simplify argument parsing (#459)
With the current state of automation scripts, this is not possible anymore to launch script with multiple auto configs.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from common import dates, github, http, releasedata
|
||||
from common import dates, github, http
|
||||
from common.releasedata import ProductData, config_from_argv
|
||||
|
||||
"""Fetch released versions from docs.chef.io and retrieve their date from GitHub.
|
||||
docs.chef.io needs to be scraped because not all tagged versions are actually released.
|
||||
@@ -6,13 +7,13 @@ docs.chef.io needs to be scraped because not all tagged versions are actually re
|
||||
More context on https://github.com/endoflife-date/endoflife.date/pull/4425#discussion_r1447932411.
|
||||
"""
|
||||
|
||||
for config in releasedata.list_configs_from_argv():
|
||||
with releasedata.ProductData(config.product) as product_data:
|
||||
html = http.fetch_html(config.url)
|
||||
released_versions = [h2.get('id') for h2 in html.find_all('h2', id=True) if h2.get('id')]
|
||||
config = config_from_argv()
|
||||
with ProductData(config.product) as product_data:
|
||||
html = http.fetch_html(config.url)
|
||||
released_versions = [h2.get('id') for h2 in html.find_all('h2', id=True) if h2.get('id')]
|
||||
|
||||
for release in github.fetch_releases("inspec/inspec"):
|
||||
sanitized_version = release.tag_name.replace("v", "")
|
||||
if sanitized_version in released_versions:
|
||||
date = dates.parse_datetime(release.published_at)
|
||||
product_data.declare_version(sanitized_version, date)
|
||||
for release in github.fetch_releases("inspec/inspec"):
|
||||
sanitized_version = release.tag_name.replace("v", "")
|
||||
if sanitized_version in released_versions:
|
||||
date = dates.parse_datetime(release.published_at)
|
||||
product_data.declare_version(sanitized_version, date)
|
||||
|
||||
Reference in New Issue
Block a user