fix: de-dupe doctor manifest repairs (#73235) (thanks @zqchris) · openclaw/openclaw@2f7c407
steipete
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,14 @@ function readManifestJson(manifestPath: string): Record<string, unknown> | null
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
| 37 | +function manifestSeenKey(manifestPath: string): string { |
| 38 | +try { |
| 39 | +return fs.realpathSync.native(manifestPath); |
| 40 | +} catch { |
| 41 | +return path.resolve(manifestPath); |
| 42 | +} |
| 43 | +} |
| 44 | + |
37 | 45 | function buildLegacyManifestContractMigration(params: { |
38 | 46 | manifestPath: string; |
39 | 47 | raw: Record<string, unknown>; |
@@ -99,10 +107,11 @@ export function collectLegacyPluginManifestContractMigrations(params?: {
|
99 | 107 | continue; |
100 | 108 | } |
101 | 109 | const manifestPath = path.join(root, entry.name, "openclaw.plugin.json"); |
102 | | -if (seen.has(manifestPath)) { |
| 110 | +const seenKey = manifestSeenKey(manifestPath); |
| 111 | +if (seen.has(seenKey)) { |
103 | 112 | continue; |
104 | 113 | } |
105 | | -seen.add(manifestPath); |
| 114 | +seen.add(seenKey); |
106 | 115 | const raw = readManifestJson(manifestPath); |
107 | 116 | if (!raw) { |
108 | 117 | continue; |
@@ -120,10 +129,11 @@ export function collectLegacyPluginManifestContractMigrations(params?: {
|
120 | 129 | ...(params?.env ? { env: params.env } : {}), |
121 | 130 | ...(params?.workspaceDir ? { workspaceDir: params.workspaceDir } : {}), |
122 | 131 | }).plugins) { |
123 | | -if (seen.has(plugin.manifestPath)) { |
| 132 | +const seenKey = manifestSeenKey(plugin.manifestPath); |
| 133 | +if (seen.has(seenKey)) { |
124 | 134 | continue; |
125 | 135 | } |
126 | | -seen.add(plugin.manifestPath); |
| 136 | +seen.add(seenKey); |
127 | 137 | const raw = readManifestJson(plugin.manifestPath); |
128 | 138 | if (!raw) { |
129 | 139 | continue; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。