UNPKG

generator-begcode

Version:

Spring Boot + Angular/React/Vue in one handy generator

16 lines (15 loc) 712 B
import { extname } from 'path'; import { passthrough } from '@yeoman/transform'; import { isFileStateDeleted } from 'mem-fs-editor/state'; import { addJavaAnnotation } from './add-java-annotation.js'; const generatedAnnotationTransform = packageName => { return passthrough(file => { if (!file.path.endsWith('package-info.java') && extname(file.path) === '.java' && !isFileStateDeleted(file) && !file.path.endsWith('GeneratedByJHipster.java')) { file.contents = Buffer.from(addJavaAnnotation(file.contents.toString('utf8'), { package: packageName, annotation: 'GeneratedByBegcode' })); } }); }; export default generatedAnnotationTransform;