Files
2026-08-28 11:43:34 -04:00

41 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python3
"""Wrapper script for last30days engine — handles config and invocation."""
import subprocess
import sys
import os
from pathlib import Path
ENGINE_DIR = Path.home() / "workspace" / "last30days-skill"
ENGINE_SCRIPT = ENGINE_DIR / "skills" / "last30days" / "scripts" / "last30days.py"
def main():
if not ENGINE_SCRIPT.exists():
print(f"❌ Engine not found at {ENGINE_SCRIPT}", file=sys.stderr)
print("Clone it: git clone https://github.com/mvanhorn/last30days-skill.git ~/workspace/last30days-skill", file=sys.stderr)
sys.exit(1)
# Forward all args to the engine
cmd = ["python3", str(ENGINE_SCRIPT)] + sys.argv[1:]
result = subprocess.run(
cmd,
cwd=str(ENGINE_DIR),
capture_output=True,
text=True,
timeout=120
)
# Print stderr first (diagnostics, warnings)
if result.stderr:
print(result.stderr, file=sys.stderr, end="")
# Print stdout (the actual results)
if result.stdout:
print(result.stdout)
sys.exit(result.returncode)
if __name__ == "__main__":
main()