Skip to content

Commit d755ee3

Browse files
committed
Fixed issue of failing duplicate line ending removal
and therefore failing jhipster jdl command. Also workaround prettier formatting to cause producing duplicate entries in the class
1 parent f07e7f1 commit d755ee3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

generators/spring-boot-javers/generator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class extends BaseApplicationGenerator {
2222
},
2323
async addNeedle({ application, source }) {
2424
source.addEntityToAuditedEntityEnum = ({ entityAuditEnumValue, entityAbsoluteClass, entityAuditEventType }) => {
25-
const enumValueDeclaration = `${entityAuditEnumValue}(${entityAbsoluteClass}.class, "${entityAuditEventType}")`;
25+
const enumValueDeclaration = `${entityAuditEnumValue}( ${entityAbsoluteClass}.class, "${entityAuditEventType}" )`;
2626
this.editFile(
2727
`${application.javaPackageSrcDir}config/audit/AuditedEntity.java`,
2828
createNeedleCallback({
@@ -39,7 +39,7 @@ export default class extends BaseApplicationGenerator {
3939
const needleIndex = content.indexOf(' // jhipster-needle-add-audited-entities');
4040
let beforeContent = content.substring(0, needleIndex);
4141
// Drop extra line ending if it exists, can be caused by prettier formatting
42-
beforeContent = beforeContent.endsWith('/n/n') ? beforeContent.slice(0, -1) : beforeContent;
42+
beforeContent = beforeContent.endsWith('\n\n') ? beforeContent.slice(0, -1) : beforeContent;
4343
const afterContent = content.substring(needleIndex);
4444

4545
if (!beforeContent.includes(needleValuePrefix) || !beforeContent.endsWith(needleValueSuffix)) {

0 commit comments

Comments
 (0)