Skip to content

Commit 42886b4

Browse files
authored
jdl: normalize windows path when looking for entities (#28765)
* jdl: normalize windows path when looking for entities * Update update-application-entities-transform.ts
1 parent dc79c58 commit 42886b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

generators/base-application/support/update-application-entities-transform.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { basename, join } from 'path';
33
import { loadFile } from 'mem-fs';
44
import type { MemFsEditorFile } from 'mem-fs-editor';
55
import { Minimatch } from 'minimatch';
6+
import normalizePath from 'normalize-path';
67
import { transform } from 'p-transform';
78
import { GENERATOR_JHIPSTER } from '../../generator-constants.js';
89

@@ -16,15 +17,15 @@ export const updateApplicationEntitiesTransform = ({
1617
let yoRcFileInMemory: MemFsEditorFile | undefined;
1718
const entities: string[] = [];
1819
const yoRcFilePath = join(destinationPath, '.yo-rc.json');
19-
const entitiesMatcher = new Minimatch(`${destinationPath}/.jhipster/*.json`);
20+
const entitiesMatcher = new Minimatch(`${normalizePath(destinationPath)}/.jhipster/*.json`);
2021

2122
return transform<MemFsEditorFile>(
2223
file => {
2324
if (file.path === yoRcFilePath) {
2425
yoRcFileInMemory = file;
2526
return undefined;
2627
}
27-
if (entitiesMatcher.match(file.path)) {
28+
if (entitiesMatcher.match(normalizePath(file.path))) {
2829
entities.push(basename(file.path).replace('.json', ''));
2930
}
3031
return file;

0 commit comments

Comments
 (0)