add_package

Adds a package to the existing config.JSON file.  This is a standalone function
to handle this functionality.  The existing config.JSON is read in and is left
unchanged.

def add_package(pkg_type, pkg_name, working=None):
    """add_package

Adds a package to the existing config.JSON file.  This is a standalone function
to handle this functionality.  The existing config.JSON is read in and is left
unchanged.
    """
    kvp = {pkg_type: pkg_name}
    working = os.getcwd() if not working else os.path.abspath(working)
    if '-dist/scripts' in working:
        config = working + "/config.JSON"
    elif '-dist' in working:
        config = working + "/scripts/config.JSON"
    else:
        config = working + "/*-dist/scripts/config.JSON"
        entropy = glob.glob(config)
        if entropy:
            config = entropy[0]  # we'll just assume it's the first one...
    print("config", config, 'working', working)
    config = load_config(config)
    config.update(kvp)
    export_to_json(config)