#!/usr/bin/env python3
from __future__ import annotations

import sys
from pathlib import Path

# The plugin runs this with whatever `python3` the machine has: say so plainly
# rather than fail on newer syntax. A hook still exits 0.
if sys.version_info < (3, 9):  # noqa: UP036
    major, minor = sys.version_info[:2]
    sys.stderr.write(
        f"cc-ghostty needs Python 3.9 or newer; `python3` is {major}.{minor}\n"
    )
    sys.exit(0 if sys.argv[1:2] == ["hook"] else 1)

sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src"))

from cc_ghostty.cli import main

sys.exit(main())
