test(plugins): keep npm peer prune mock directory-safe · openclaw/openclaw@a12e302
vincentkoc
·
2026-05-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -223,7 +223,14 @@ function prunePluginLocalOpenClawPeerLinks(npmRoot: string) {
|
223 | 223 | .map((scopedEntry) => path.join(entryPath, scopedEntry.name)) |
224 | 224 | : [entryPath]; |
225 | 225 | for (const packageDir of packageDirs) { |
226 | | -fs.rmSync(path.join(packageDir, "node_modules", "openclaw"), { |
| 226 | +const packageNodeModulesDir = path.join(packageDir, "node_modules"); |
| 227 | +const packageNodeModules = fs.existsSync(packageNodeModulesDir) |
| 228 | + ? fs.lstatSync(packageNodeModulesDir) |
| 229 | + : null; |
| 230 | +if (packageNodeModules && !packageNodeModules.isDirectory()) { |
| 231 | +continue; |
| 232 | +} |
| 233 | +fs.rmSync(path.join(packageNodeModulesDir, "openclaw"), { |
227 | 234 | recursive: true, |
228 | 235 | force: true, |
229 | 236 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。