import os

import cfgtools

default_delivery_type = None


def get_default_delivery_type():
    # type: (...) -> str

    global default_delivery_type

    if default_delivery_type is None:
        config = cfgtools.read(os.environ["LOADERCFG"])
        default_delivery_type = config.find_value("Customizations.DefaultDeliveryType", "delivery")

    return default_delivery_type.lower()
