mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:30:42 +00:00
27 lines
698 B
TypeScript
27 lines
698 B
TypeScript
import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";
|
|
|
|
const IGNORED_INSTALLED_PLUGIN_DIR_NAMES = new Set(["node_modules", ".openclaw-install-backups"]);
|
|
|
|
export function shouldIgnoreInstalledPluginDirName(name: string): boolean {
|
|
const normalized = normalizeOptionalLowercaseString(name);
|
|
if (!normalized) {
|
|
return true;
|
|
}
|
|
if (IGNORED_INSTALLED_PLUGIN_DIR_NAMES.has(normalized)) {
|
|
return true;
|
|
}
|
|
if (normalized.startsWith(".")) {
|
|
return true;
|
|
}
|
|
if (normalized.endsWith(".bak")) {
|
|
return true;
|
|
}
|
|
if (normalized.includes(".backup-")) {
|
|
return true;
|
|
}
|
|
if (normalized.includes(".disabled")) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|