#!/usr/bin/env node

/**
 * Bud file for terms of use
 * Executing this file renders terms of use files.
 *
 * Generated by {{generator}} on {{today}},
 * from a template provided by {{pkg.name}}.
 *
 * @see https://github.com/coz-repo/coz
 */

"use strict";

const apeman = require('apeman'),
    apemanBudTerms = require('apeman-bud-terms');

const $ctx = apeman.ctx(__dirname),
    loc = $ctx.loc || {};

module.exports = '{{{params.langs}}}'.split(',')
    .map(lang => loc[lang])
    .filter(l => !!l)
    .map(l => apemanBudTerms({
            lang: l.$lang,
            org: l('org.ORG_NAME'),
            email: l('org.ORG_EMAIL'),
            homepage: l('org.OGE_HOMEPAGE')
        })
    ).reduce((a, b)=>[].concat(a, b), []);

{{{read _render}}}
