packages/generator-liferay-theme/lib/utils/Copier.js
/**
	 * Instantiate all Yeoman template files found in a directory tree.
	 * @param  {String} src path to template
	 * @param  {Object} context optional context object to use when
	 * 						instantiating the template (defaults to {})
	 */
Instantiate all Yeoman template files found in a directory tree.
@param  {String} src path to template
@param  {Object} context optional context object to use when
instantiating the template (defaults to {})
Instantiate all Yeoman template files found in a directory tree . @param { String } src path to template @param { Object } context optional context object to use when instantiating the template ( defaults to {} )
copyDir(src, {context = {}} = {}) {
		const gen = this._generator;
		const files = fs.readdirSync(gen.templatePath(src));
		files.forEach(file => {
			if (file === '.DS_Store') {
				return;
			}
			const filePath = path.join(src, file);
			if (fs.statSync(gen.templatePath(filePath)).isDirectory()) {
				this.copyDir(filePath, {context});
			} else {
				const rawCopy = !filePath.endsWith('.ejs');
				this.copyFile(filePath.replace(/\.ejs$/, ''), {
					context,
					rawCopy,
				});
			}
		});
	}
copyDir ( src , { context = { } } = { } ) { const gen = this . _generator ; const files = fs . readdirSync ( gen . templatePath ( src ) ) ; files . forEach ( file => { if ( file === '.DS_Store' ) { return ; } const filePath = path . join ( src , file ) ; if ( fs . statSync ( gen . templatePath ( filePath ) ) . isDirectory ( ) ) { this . copyDir ( filePath , { context } ) ; } else { const rawCopy = ! filePath . endsWith ( '.ejs' ) ; this . copyFile ( filePath . replace ( / \.ejs$ / , '' ) , { context , rawCopy , } ) ; } } ) ; }
Instantiate all Yeoman template files found in a directory tree.
Instantiate all Yeoman template files found in a directory tree .