mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 08:41:13 +00:00
fix(plugins): preserve bundled origin when workspace matches bundled root
This commit is contained in:
@@ -319,6 +319,18 @@ function shouldIgnoreScannedDirectory(dirName: string): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
function resolvesToSameDirectory(left?: string, right?: string): boolean {
|
||||
if (!left || !right) {
|
||||
return false;
|
||||
}
|
||||
const leftRealPath = safeRealpathSync(left);
|
||||
const rightRealPath = safeRealpathSync(right);
|
||||
if (leftRealPath && rightRealPath) {
|
||||
return leftRealPath === rightRealPath;
|
||||
}
|
||||
return path.resolve(left) === path.resolve(right);
|
||||
}
|
||||
|
||||
function readPackageManifest(dir: string, rejectHardlinks = true): PackageManifest | null {
|
||||
const manifestPath = path.join(dir, "package.json");
|
||||
const opened = openBoundaryFileSync({
|
||||
@@ -910,7 +922,9 @@ export function discoverOpenClawPlugins(params: {
|
||||
seen,
|
||||
});
|
||||
}
|
||||
if (roots.workspace && workspaceRoot) {
|
||||
const workspaceMatchesBundledRoot = resolvesToSameDirectory(workspaceRoot, roots.stock);
|
||||
|
||||
if (roots.workspace && workspaceRoot && !workspaceMatchesBundledRoot) {
|
||||
discoverInDirectory({
|
||||
dir: workspaceRoot,
|
||||
origin: "workspace",
|
||||
|
||||
Reference in New Issue
Block a user