refactor: share CLI options and default paths

core.paths holds the default database, platforms, emulators and bios paths, core.cli declares the options built on them (add_repo_inputs) and the --emulator/--system modes verify and generate_pack share. model.targets.target_scope answers --target for a command line, model.profiles.no_profile_for_systems the system with no emulator. tests/sources.declared_options reads the options a script declares through either form.
This commit is contained in:
Abdessamad Derraz committed 2026-11-20 18:28:46 +01:00
1 parent 348d5b51c3
commit cf03dcb2ef
50 files changed
+260 -405

No files matched your search

+8
View File
@@ -9,6 +9,14 @@ from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[2]
# The inputs a command reads unless told otherwise, relative to the
# repository root it runs from.
DB_FILE = "database.json"
PLATFORMS_DIR = "platforms"
EMULATORS_DIR = "emulators"
BIOS_DIR = "bios"
def sanitize_pack_path(raw: str) -> str:
"""Strip traversal components from a relative destination.