mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
Merge d23f3bb30e into f6812ba886
This commit is contained in:
commit
5f51330d62
2 changed files with 30 additions and 4 deletions
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
|
@ -28,14 +28,14 @@ jobs:
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install -U pip
|
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
|
python -m pip install -U -r test/pip_reqs.txt
|
||||||
|
|
||||||
- name: Apply AutoPEP8
|
- name: Apply Black
|
||||||
run: |
|
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
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: "[ci] auto-format"
|
commit_message: "[ci] auto-format"
|
||||||
|
|
|
||||||
26
test/plugman_json_updater.py
Normal file
26
test/plugman_json_updater.py
Normal file
|
|
@ -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")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue