Skip to content

Commit

Permalink
Added support for node versions 20-22 in dependency tool
Browse files Browse the repository at this point in the history
  • Loading branch information
cockroacher authored Jan 29, 2025
1 parent 7731c0d commit 9362066
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions helpers/dependency_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,13 @@ def check_java():

def check_node():
result, error = test_cmd('node -v')
# if python_error is not None or python_error != b'':
# print('\t- Python:', 'ERROR:', python_error)
# return
if result is None:
print('\t- Node:', 'ERROR: Unknown return')
return

version = None
regex = r"v(?P<version>[0-9\.]+)"
matches = re.finditer(
regex, result, re.MULTILINE)
matches = re.finditer(regex, result, re.MULTILINE)
for _, match in enumerate(matches, start=1):
version = match.group('version')

Expand All @@ -97,12 +93,15 @@ def check_node():

version = packaging.version.Version(version)
repo_version = packaging.version.Version("20.17")
if version.major is not repo_version.major:
print('\t- Node:', 'WARNING: wrong major version')

# Check if the major version is between 20 and 22
if not (20 <= version.major <= 22):
print('\t- Node:', 'WARNING: Major version not between 20 and 22')
return

if version.minor < repo_version.minor:
print('\t- Node:', 'WARNING: wrong minor version')
# Check if the minor version is at least as high as the repository's minor version
if version.major == repo_version.major and version.minor < repo_version.minor:
print('\t- Node:', 'WARNING: Minor version is below required')
return

print('\t- Node:', 'OK')
Expand Down

0 comments on commit 9362066

Please sign in to comment.