-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbach.py
More file actions
50 lines (38 loc) · 1.27 KB
/
bach.py
File metadata and controls
50 lines (38 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
"""
BACH CLI Wrapper - Root-Level Entry Point
==========================================
Dieses Script liegt im BACH-Root und ruft system/bach.py auf.
Usage:
python bach.py <command> [args]
./bach.py --startup
Referenz: SQ013, SQ015 (Build-Fix)
Datum: 2026-02-20
"""
import os
import subprocess
import sys
from pathlib import Path
def main():
"""Wrapper-Einstiegspunkt für BACH CLI."""
# BACH Root (wo dieses Script liegt)
bach_root = Path(__file__).parent
system_bach = bach_root / "system" / "bach.py"
# Verifizieren dass system/bach.py existiert
if not system_bach.exists():
print(f"ERROR: system/bach.py nicht gefunden in {bach_root}", file=sys.stderr)
print(f" Erwartet: {system_bach}", file=sys.stderr)
sys.exit(1)
# UTF-8 Encoding setzen (Windows)
os.environ.setdefault('PYTHONIOENCODING', 'utf-8')
# system/bach.py mit allen Argumenten aufrufen
# CWD muss system/ sein, damit relative Pfade (data/bach.db) funktionieren
result = subprocess.run(
[sys.executable, str(system_bach)] + sys.argv[1:],
cwd=str(bach_root / "system")
)
sys.exit(result.returncode)
if __name__ == "__main__":
main()