/** * Bud file for paths. */ "use strict"; var u = require('apeman-util'), string = u.string, reducing = u.reducing, filtering = u.filtering, mapping = u.mapping, fs = u.core.fs, path = u.core.path; var basedir = path.resolve(__dirname, '../../'), tmplDir = path.resolve(__dirname, '../../tmpl'), hbsTmplDir = path.resolve(tmplDir, 'hbs'); module.exports = { mode: '444', force: true, get data() { return { paths: [ fs.readdirSync(hbsTmplDir) .filter(filtering.patternAcceptFilter(/\.hbs$/)) .map(mapping.pathResolveMap(hbsTmplDir)) .map(function (filename) { var name = path.basename(filename, '.hbs'); return { name: string.camelString(name) + 'Tmpl', desc: string.sentenceString(name), path: path.relative(basedir, filename) } }) ] .reduce(reducing.concatReduce(), []) } } }