Merge pull request #24312 from BethGriggs/lost+found

fix: handle lost+found directory in plugin scanner
This commit is contained in:
Fredrik Adelöw
2024-04-19 23:16:36 +02:00
committed by GitHub
3 changed files with 28 additions and 0 deletions
@@ -636,6 +636,24 @@ Please add '${mockDir.resolve(
],
},
},
{
name: 'lost+found directory should be ignored',
fileSystem: {
backstageRoot: {
'dist-dynamic': {
'lost+found': {},
},
},
},
expectedPluginPackages: [],
expectedLogs: {
debugs: [
{
message: `skipping 'lost+found' system directory`,
},
],
},
},
])('$name', async (tc: TestCase): Promise<void> => {
const logger = new MockedLogger();
const backstageRoot = mockDir.resolve('backstageRoot');
@@ -136,6 +136,11 @@ export class PluginScanner {
withFileTypes: true,
})) {
const pluginDir = dirEnt;
if (pluginDir.name === 'lost+found') {
this.logger.debug(`skipping '${pluginDir.name}' system directory`);
continue;
}
const pluginHome = path.normalize(
path.resolve(dynamicPluginsLocation, pluginDir.name),
);