Skip to content

Commit

Permalink
entries: fix slug for gbamicrojam23
Browse files Browse the repository at this point in the history
  • Loading branch information
avivace committed May 7, 2024
1 parent 0e1c3ec commit f0029a2
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 0 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions scripts/1_typetag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
Change entries with "homebrew" as typetag to "tool"
"""

import json
import os

entries_list = os.listdir("../entries")
mock = False

for entry in entries_list:
with open(f"../entries/{entry}/game.json", "r+") as f:
changes = False
manifest = json.load(f)

if "typetag" in manifest:
if manifest["typetag"] == "homebrew":
manifest["typetag"] = "tool"
print(manifest["slug"], "HOMEBREW -> TOOL")
changes = True
else:
print(manifest["slug"], "No typetag")
print(manifest)
if not mock and changes is True:
f.seek(0) # <--- should reset file position to the beginning.
json.dump(manifest, f, indent=4, ensure_ascii=False)
f.truncate() # remove remaining part

0 comments on commit f0029a2

Please sign in to comment.