#!/usr/bin/env python
#     Copyright 2025, QutaYba, nasr2python@gmail.com find license text at end of file


""" Launcher for nexium the compiler itself.

"""

# Import as little as possible initially, because we might be re-executing
# soon.
import os
import sys

# Unchanged, running from checkout, use the parent directory, the qutayba
# package ought to be there.
sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "..")))

# isort:start

import qutayba.__main__  # false alarm, pylint: disable=I0021,no-name-in-module

# Remove the qutayba package directory again, it might contain other stuff that we
# do not want added automatically.
del sys.path[0]

# The bin folder of the runner can't be that helpful, but got added automatically,
# so attempt to remove it.
sys.path = [
    path_element
    for path_element in sys.path
    if os.path.dirname(os.path.abspath(__file__)) != path_element
]

# Now execute nexium in a clean environment.
qutayba.__main__.main()


