1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-19 05:09:40 +02:00

chore: automatic crowdin sync via gh actions (#5630)

This commit is contained in:
Hayden 2025-07-04 19:00:23 -05:00 committed by GitHub
parent c9e22892a6
commit 9cce0f65aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 161 additions and 21 deletions

View file

@ -1,3 +1,4 @@
import argparse
from pathlib import Path
import gen_py_pytest_data_paths
@ -11,15 +12,39 @@ CWD = Path(__file__).parent
def main():
items = [
(gen_py_schema_exports.main, "schema exports"),
(gen_ts_types.main, "frontend types"),
(gen_ts_locales.main, "locales"),
(gen_py_pytest_data_paths.main, "test data paths"),
(gen_py_pytest_routes.main, "pytest routes"),
]
parser = argparse.ArgumentParser(description="Run code generators")
parser.add_argument(
"generators",
nargs="*",
help="Specific generators to run (schema, types, locales, data-paths, routes). If none specified, all will run.", # noqa: E501 - long line
)
args = parser.parse_args()
for func, name in items:
# Define all available generators
all_generators = {
"schema": (gen_py_schema_exports.main, "schema exports"),
"types": (gen_ts_types.main, "frontend types"),
"locales": (gen_ts_locales.main, "locales"),
"data-paths": (gen_py_pytest_data_paths.main, "test data paths"),
"routes": (gen_py_pytest_routes.main, "pytest routes"),
}
# Determine which generators to run
if args.generators:
# Validate requested generators
invalid_generators = [g for g in args.generators if g not in all_generators]
if invalid_generators:
log.error(f"Invalid generator(s): {', '.join(invalid_generators)}")
log.info(f"Available generators: {', '.join(all_generators.keys())}")
return
generators_to_run = [(all_generators[g][0], all_generators[g][1]) for g in args.generators]
else:
# Run all generators (default behavior)
generators_to_run = list(all_generators.values())
# Run the selected generators
for func, name in generators_to_run:
log.info(f"Generating {name}...")
func()