Creates a config file.

    Attempts to load data from legacy config files if they exist.

def make_config(path):
    """Creates a config file.

    Attempts to load data from legacy config files if they exist.
    """
    apps, user = load_legacy_config()

    apps = {a.instance: a._asdict() for a in apps}
    users = {user_id(user): user._asdict()} if user else {}
    active_user = user_id(user) if user else None

    config = {
        "apps": apps,
        "users": users,
        "active_user": active_user,
    }

    print_out("Creating config file at <blue>{}</blue>".format(path))

    # Ensure dir exists
    os.makedirs(dirname(path), exist_ok=True)

    with open(path, 'w') as f:
        json.dump(config, f, indent=True)