Skip to content

Commit

Permalink
Hotfix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecialBuilder32 committed Oct 4, 2023
1 parent f6e3aff commit 8584892
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion gm4/plugins/upgrade_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def lib(ctx: Context):
score_holder = ctx.project_id.removeprefix('gm4_')
manifest = ManifestCacheModel.parse_obj(ctx.cache["gm4_manifest"].json)
ver_str = manifest.libraries.get(ctx.project_id.replace("gm4_", "lib_"), NoneAttribute()).version or "0.0.0"
ver_int = Version(ver_str).int_rep()
ver = Version(ver_str)
if ver.patch is None:
ver.patch = 0 # when beet-dev is run, pipeline has no patch number record, but dev builds should still allow int conversion
ver_int = ver.int_rep()
ctx.data.functions[f'{ctx.project_id}:load'].append(f'execute unless score {score_holder} gm4_earliest_version matches ..{ver_int} run scoreboard players set {score_holder} gm4_earliest_version {ver_int}')

beet_default(ctx)
4 changes: 3 additions & 1 deletion gm4/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def int_rep(self) -> int:
return 100_000*self.major + 1_000*self.minor + self.patch # type: ignore

def __eq__(self, other: object) -> bool:
if isinstance(other, Version):
if other is None:
return False
elif isinstance(other, Version):
return self.major==other.major and self.minor==other.minor and self.patch==other.patch
raise TypeError

Expand Down

0 comments on commit 8584892

Please sign in to comment.