Skip to content

Commit

Permalink
consolidate.py: ignore extensions without valid versions
Browse files Browse the repository at this point in the history
Ideally such extensions shouldn't be accepted into the repository to start with, but good to have a fallback behaviour in case all SemVer compliant docker images get removed or something.
  • Loading branch information
ES-Alexander authored and patrickelectric committed Jan 26, 2024
1 parent d9299cc commit 2b6fcc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blueos_repository/consolidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ async def run(self) -> None:
repository.versions = dict(
sorted(repository.versions.items(), key=lambda i: self.valid_semver(i[0]), reverse=True) # type: ignore
)
self.consolidated_data.append(repository)
if repository.versions: # only include if there's at least one valid version
self.consolidated_data.append(repository)

with open("manifest.json", "w", encoding="utf-8") as manifest_file:
manifest_file.write(json.dumps(self.consolidated_data, indent=4, cls=EnhancedJSONEncoder))
Expand Down

0 comments on commit 2b6fcc9

Please sign in to comment.