# Mono Repo Global Version
__version__ = "0.8.1-beta.2"
# elsewhere we can call this file: `python VERSION` and simply take the stdout

# stdlib
import os
import subprocess
import sys


def get_version() -> str:
    return __version__


def get_hash() -> str:
    cwd = os.path.dirname(os.path.abspath(__file__))
    output = subprocess.check_output("git rev-parse HEAD".split(" "), cwd=cwd)
    return output.strip().decode("ascii")


if __name__ == "__main__":
    if len(sys.argv) > 1 and "hash" in sys.argv[1]:
        print(get_hash())
    else:
        print(get_version())
