Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install -U pip
python -m pip install -U pycodestyle==2.12.1 autopep8
python -m pip install -U black
python -m pip install -U -r test/pip_reqs.txt

- name: Apply AutoPEP8
- name: Apply Black
run: |
autopep8 --in-place --recursive --max-line-length=100 .
black . --line-length 80 --skip-string-normalization

- name: Commit AutoPEP8
- name: Commit Black
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[ci] auto-format"
Expand Down
26 changes: 26 additions & 0 deletions test/plugman_json_updater.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# crafted by brostos
import json

plugin_category = ["maps", "minigames", "utilities"]
plugin_names_by_category = {}

for category in plugin_category:
with open(f"plugins/{category}/{category}.json", "r+") as file:
data = json.load(file)
plugins = data["plugins"]
plugin_names_by_category[category] = list(plugins.keys())

for plugin in plugin_names_by_category[category]:
latest_version = int(next(iter(plugins[plugin]["versions"])).replace(".", ""))
current_version = ".".join(str(latest_version + 1))
plugins[plugin]["versions"][current_version] = None
# Ensure latest version appears first
plugins[plugin]["versions"] = dict(
sorted(plugins[plugin]["versions"].items(), reverse=True)
)
# json.dump(plugins, indent=2)
file.seek(0)
json.dump(data, file, indent=2, ensure_ascii=False)
# Ensure old content is removed
file.truncate()
print(f"All {category} version have been upgraded")