UNPKG

@sap/generator-cap-project

Version:

Creates a new SAP Cloud Application Programming Model project.

22 lines (21 loc) 768 B
import { isBinary, render } from '../util.js'; export function _processTpl({ contents, filename, context, tplSettings, }) { if (isBinary(filename, contents)) { return contents; } return render(contents.toString(), context, { // Setting filename by default allow including partials. filename, cache: true, ...tplSettings, }); } export function copyTpl(from, to, context, tplSettings, options) { context = context || {}; tplSettings = tplSettings || {}; this.copy(from, to, { processDestinationPath: (path) => path.replace(/.ejs$/, ''), ...options, process: (contents, filename) => this._processTpl({ contents, filename, context, tplSettings }), }, context, tplSettings); }