# -*- coding: utf-8 -*-
from setuphelpers import *

app_name="Tea CLI"
app_dir = makepath('C:', 'Program Files', 'Tea')

def install():
    # Declare local variables
    binary = glob.glob(rf"tea*.exe")[0]
    binary_path = rf"{app_dir}\{binary}"

    # Copy the software in program files
    if not isdir(app_dir):
        mkdirs(app_dir)

    if not isfile(binary_path):
        filecopyto(rf"{basedir}\{binary}",binary_path)

def audit():
    audit_status = "OK"

    if isdir(app_dir) and not dir_is_empty(app_dir):
        print(rf"{app_name} is installed")
        audit_status = "OK"
    else:
        print(rf"{app_name} is not installed")
        audit_status = "ERROR"

    return audit_status

def uninstall():
    if isdir(app_dir):
        remove_tree(app_dir)