Skip to content

Commit

Permalink
Entering existence check for version. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVenturini committed May 24, 2019
1 parent ad5d271 commit 9ec5d37
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ def get_times(time, date):
return versions


# get the resolved version and verify if exists
def get_version(versions, svr):
resolved_version = svr.best_satisfies(versions)
# verify if resolved_version exists
# if ntw.exists(resolved_version):
# return resolved_versions
# else:
# versions.remove(resolved_version)
# return get_version(versions, svr)
return resolved_version


# get only the versions that is major
# get all package.json's and get the maximum version of specify range version
def resolve_version(dependency, version, date):
Expand All @@ -48,7 +60,7 @@ def resolve_version(dependency, version, date):
nvrp = NodeVersionRangeParser()
svr = nvrp.parse(version)
# get the best satisfies range
new_version = svr.best_satisfies(versions)
new_version = get_version(versions, svr)

# if one version satisfies
if new_version:
Expand Down

0 comments on commit 9ec5d37

Please sign in to comment.