mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:17:40 +00:00
fix(plugins): ignore archived extension dirs during discovery
Co-authored-by: chenzhuoms <chenzhuoms@users.noreply.github.com>
This commit is contained in:
@@ -206,6 +206,23 @@ function isExtensionFile(filePath: string): boolean {
|
||||
return !filePath.endsWith(".d.ts");
|
||||
}
|
||||
|
||||
function shouldIgnoreScannedDirectory(dirName: string): boolean {
|
||||
const normalized = dirName.trim().toLowerCase();
|
||||
if (!normalized) {
|
||||
return true;
|
||||
}
|
||||
if (normalized.endsWith(".bak")) {
|
||||
return true;
|
||||
}
|
||||
if (normalized.includes(".backup-")) {
|
||||
return true;
|
||||
}
|
||||
if (normalized.includes(".disabled")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function readPackageManifest(dir: string): PackageManifest | null {
|
||||
const manifestPath = path.join(dir, "package.json");
|
||||
if (!fs.existsSync(manifestPath)) {
|
||||
@@ -362,6 +379,9 @@ function discoverInDirectory(params: {
|
||||
if (!entry.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
if (shouldIgnoreScannedDirectory(entry.name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const manifest = readPackageManifest(fullPath);
|
||||
const extensions = manifest ? resolvePackageExtensions(manifest) : [];
|
||||
|
||||
Reference in New Issue
Block a user