#!/usr/bin/env python3
"""Repo-local launcher: run luna-doctor straight from a checkout.

The code lives in the `luna_doctor` package next door. `pip install .` and
`pipx install .` install that package and get a console script that imports it
directly; this file exists for the install path that skips packaging entirely:

    ln -s "$PWD/bin/luna-doctor" ~/.local/bin/luna-doctor

It resolves its own symlink with realpath, then puts the checkout on sys.path,
so the package is found whether this file is run in place or through a symlink.
"""

import os
import sys

sys.path.insert(
    0, os.path.dirname(os.path.dirname(os.path.realpath(os.path.abspath(__file__))))
)

from luna_doctor.cli import main  # noqa: E402

if __name__ == "__main__":
    try:
        sys.exit(main())
    except KeyboardInterrupt:
        sys.exit(130)
