Skip to content

Commit

Permalink
Merge pull request #26503 from mshima/v7-files
Browse files Browse the repository at this point in the history
workaround v7 files structure bug
  • Loading branch information
DanielFran committed Jun 21, 2024
2 parents 515a053 + 1f4fb3f commit 9d51e35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion generators/base-core/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,16 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
let sourceFileFrom;
if (Array.isArray(rootTemplatesAbsolutePath)) {
// Look for existing templates
const existingTemplates = rootTemplatesAbsolutePath
let existingTemplates = rootTemplatesAbsolutePath
.map(rootPath => this.templatePath(rootPath, sourceFile))
.filter(templateFile => existsSync(appendEjs ? `${templateFile}.ejs` : templateFile));

if (existingTemplates.length === 0 && this.getFeatures().jhipster7Migration) {
existingTemplates = rootTemplatesAbsolutePath
.map(rootPath => this.templatePath(rootPath, appendEjs ? sourceFile : `${sourceFile}.ejs`))
.filter(templateFile => existsSync(templateFile));
}

if (existingTemplates.length > 1) {
const moreThanOneMessage = `Multiples templates were found for file ${sourceFile}, using the first
templates: ${JSON.stringify(existingTemplates, null, 2)}`;
Expand Down

0 comments on commit 9d51e35

Please sign in to comment.