Resolve the target for globbed file locations correctly
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Resolve the `target` for glob `file` locations correctly
|
||||
@@ -79,6 +79,14 @@ describe('FileReaderProcessor', () => {
|
||||
|
||||
expect(emit).toBeCalledTimes(2);
|
||||
expect(emit.mock.calls[0][0].entity).toEqual({ kind: 'Component' });
|
||||
expect(emit.mock.calls[0][0].location).toEqual({
|
||||
type: 'file',
|
||||
target: expect.stringMatching(/^[^*]*$/),
|
||||
});
|
||||
expect(emit.mock.calls[1][0].entity).toEqual({ kind: 'API' });
|
||||
expect(emit.mock.calls[1][0].location).toEqual({
|
||||
type: 'file',
|
||||
target: expect.stringMatching(/^[^*]*$/),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,7 +41,10 @@ export class FileReaderProcessor implements CatalogProcessor {
|
||||
for (const fileMatch of fileMatches) {
|
||||
const data = await fs.readFile(fileMatch);
|
||||
|
||||
for (const parseResult of parseEntityYaml(data, location)) {
|
||||
for (const parseResult of parseEntityYaml(data, {
|
||||
type: 'file',
|
||||
target: fileMatch,
|
||||
})) {
|
||||
emit(parseResult);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user