Chore(Fortune): replace shell script with Python for better compatibility

This commit is contained in:
2025-02-18 10:44:10 +08:00
parent c5e6dedfe4
commit 0b31ee45a8
2 changed files with 21 additions and 12 deletions

View File

@@ -11,10 +11,26 @@ repos:
- repo: local
hooks:
- id: check-special-event
name: check-special-event
entry: bash scripts/check-events.sh
language: system
files: ^fortune_generator/json/.*_special\.json$
- id: check-cyclical-event
name: check-cyclical-event
entry: python3 scripts/check-events.py fortune_generator/json/cyclical_special.json cyclical
language: python
files: fortune_generator/json/cyclical_special.json
types: [json]
pass_filenames: false
- id: check-custom-event
name: check-custom-event
entry: python3 scripts/check-events.py fortune_generator/json/custom_special.json custom
language: python
files: fortune_generator/json/custom_special.json
types: [json]
pass_filenames: false
- id: check-static-event
name: check-static-event
entry: python3 scripts/check-events.py fortune_generator/json/static_special.json static
language: python
files: fortune_generator/json/static_special.json
types: [json]
pass_filenames: false

View File

@@ -1,7 +0,0 @@
#!/bin/sh
set -e
python3 scripts/check-events.py fortune_generator/json/custom_special.json custom
python3 scripts/check-events.py fortune_generator/json/cyclical_special.json cyclical
python3 scripts/check-events.py fortune_generator/json/static_special.json static