# Path: mod/log.py
# RED = '\033[1;31m'
# GREEN = '\033[1;32m'
# YELLOW = '\033[1;33m'
# BLUE = '\033[1;36m'
# DEF = '\033[0;0m'
# def error(msg, fatal=True) :
# def warn(msg) :
# def ok(item, status) :
# def failed(item, status) :
# def optional(item, status) :
# def info(msg) :
# def colored(color, msg) :
# 
# Path: mod/emsdk.py
# EMSDK_URL = "https://github.com/emscripten-core/emsdk.git"
# EMSDK_DEFAULT_VERSION = 'latest'
# def remove_readonly(func, path, _):
# def get_sdkroot_dir(fips_dir):
# def sdkroot_exists(fips_dir):
# def make_dirs(fips_dir):
# def get_emsdk_dir(fips_dir):
# def emsdk_dir_exists(fips_dir):
# def get_emsdk_path(fips_dir):
# def check_exists(fips_dir):
# def get_em_config(fips_dir):
# def run(fips_dir, cmdline):
# def clone_or_update_emsdk(fips_dir):
# def list(fips_dir):
# def activate(fips_dir, emsdk_version):
# def install(fips_dir, emsdk_version):
# def remove_old_sdks(fips_dir):
# def uninstall(fips_dir):
# def parse_config(fips_dir):
# def show_config(fips_dir):
# def get_emscripten_root(fips_dir):


from mod import log, emsdk
"""

#-------------------------------------------------------------------------------
def run(fips_dir, proj_dir, args):
    if len(args) > 0:
        cmd = args[0]
        if cmd == 'install':
            emsdk_version = None
            if len(args) > 1:
                emsdk_version = args[1]
            emsdk.install(fips_dir, emsdk_version)
        elif cmd == 'list':
            emsdk.list(fips_dir)
        elif cmd == 'activate':
            if len(args) > 1:
                emsdk_version = args[1]
                emsdk.activate(fips_dir, emsdk_version)
            else:
                log.error("emscripten SDK version expected (run './fips emsdk list')")
        elif cmd == 'uninstall':
            emsdk.uninstall(fips_dir)
        elif cmd == 'show-config':
            emsdk.show_config(fips_dir)
        elif cmd == 'show-em-config':
            log.info(emsdk.get_em_config(fips_dir))
        elif cmd == 'show-emscripten-root':
            log.info(emsdk.get_emscripten_root(fips_dir))
        else:
            log.error("unknown subcommand '{}' (run './fips help emsdk')".format(cmd))
    else:

# Path: mod/log.py
# RED = '\033[1;31m'
# GREEN = '\033[1;32m'
# YELLOW = '\033[1;33m'
# BLUE = '\033[1;36m'
# DEF = '\033[0;0m'
# def error(msg, fatal=True) :
# def warn(msg) :
# def ok(item, status) :
# def failed(item, status) :
# def optional(item, status) :
# def info(msg) :
# def colored(color, msg) :
# 
# Path: mod/emsdk.py
# EMSDK_URL = "https://github.com/emscripten-core/emsdk.git"
# EMSDK_DEFAULT_VERSION = 'latest'
# def remove_readonly(func, path, _):
# def get_sdkroot_dir(fips_dir):
# def sdkroot_exists(fips_dir):
# def make_dirs(fips_dir):
# def get_emsdk_dir(fips_dir):
# def emsdk_dir_exists(fips_dir):
# def get_emsdk_path(fips_dir):
# def check_exists(fips_dir):
# def get_em_config(fips_dir):
# def run(fips_dir, cmdline):
# def clone_or_update_emsdk(fips_dir):
# def list(fips_dir):
# def activate(fips_dir, emsdk_version):
# def install(fips_dir, emsdk_version):
# def remove_old_sdks(fips_dir):
# def uninstall(fips_dir):
# def parse_config(fips_dir):
# def show_config(fips_dir):
# def get_emscripten_root(fips_dir):


# Path: verbs/emsdk.py
from mod import log, emsdk

"""

#-------------------------------------------------------------------------------
def run(fips_dir, proj_dir, args):
    if len(args) > 0:
        cmd = args[0]
        if cmd == 'install':
            emsdk_version = None
            if len(args) > 1:
                emsdk_version = args[1]
            emsdk.install(fips_dir, emsdk_version)
        elif cmd == 'list':
            emsdk.list(fips_dir)
        elif cmd == 'activate':
            if len(args) > 1:
                emsdk_version = args[1]
                emsdk.activate(fips_dir, emsdk_version)
            else:
                log.error("emscripten SDK version expected (run './fips emsdk list')")
        elif cmd == 'uninstall':
            emsdk.uninstall(fips_dir)
        elif cmd == 'show-config':
            emsdk.show_config(fips_dir)
        elif cmd == 'show-em-config':
            log.info(emsdk.get_em_config(fips_dir))
        elif cmd == 'show-emscripten-root':
            log.info(emsdk.get_emscripten_root(fips_dir))
        else:
            log.error("unknown subcommand '{}' (run './fips help emsdk')".format(cmd))
    else:

        log.error("expected a subcommand (install, list, activate, update or uninstall)")