"""
System and platform utilities for wittrans.

SPDX-FileCopyrightText: 2024 Jiri Grönroos <jiri.gronroos@iki.fi>

SPDX-License-Identifier: LGPL-3.0-or-later
"""

import sys

from rich.console import Console


def check_platform() -> None:
    """Check that the platform is Linux."""
    console = Console()
    if sys.platform == "linux" or sys.platform == "linux2":
        pass
    elif sys.platform == "darwin":
        console.print(
            "wittrans must be run on a Linux distribution, macOS is not supported. Exiting."
        )
        sys.exit(1)
    elif sys.platform == "win32":
        console.print(
            "wittrans must be run on a Linux distribution, Windows is not supported. Exiting."
        )
        sys.exit(1)
