#!/usr/bin/env python3
import sys
import os

# When installed as a package, modules live in /usr/lib/teavpn
_INSTALLED_LIB = "/usr/lib/teavpn"
if os.path.isdir(os.path.join(_INSTALLED_LIB, "teavpn")) and _INSTALLED_LIB not in sys.path:
    sys.path.insert(0, _INSTALLED_LIB)

# Also check relative to script location (for running from source tree)
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
PKG_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, ".."))
if os.path.isdir(os.path.join(PKG_ROOT, "teavpn")) and PKG_ROOT not in sys.path:
    sys.path.insert(0, PKG_ROOT)

from teavpn.cli import main

if __name__ == "__main__":
    main()
