fix: handle lost+found directory in plugin scanner
Signed-off-by: Beth Griggs <bethanyngriggs@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-dynamic-feature-service': patch
|
||||
---
|
||||
|
||||
Updates the `scanRoot` method in the `PluginScanner` class to specifically ignore the `lost+found` directory, which is a system-generated directory used for file recovery on Unix-like systems. Skipping this directory avoids unnecessary errors.
|
||||
@@ -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),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user