修 sandbox:筛远程技能挂载依既有根 · openclaw/openclaw@dd5fb1e
jason-allen-
·
2026-05-24
·
via Recent Commits to openclaw:main
| 原文行号 | 差异行号 | 差异行变 |
|---|
|
| 1 | +import fs from "node:fs"; |
1 | 2 | import path from "node:path"; |
2 | 3 | import { isPathInside } from "../../infra/path-guards.js"; |
3 | 4 | import type { |
@@ -563,7 +564,15 @@ function buildRemoteProtectedSkillMounts(params: {
|
563 | 564 | }, |
564 | 565 | ); |
565 | 566 | } |
566 | | -return mounts; |
| 567 | +return mounts.filter((mount) => isExistingDirectory(mount.localRoot)); |
| 568 | +} |
| 569 | + |
| 570 | +function isExistingDirectory(dir: string): boolean { |
| 571 | +try { |
| 572 | +return fs.statSync(dir).isDirectory(); |
| 573 | +} catch { |
| 574 | +return false; |
| 575 | +} |
567 | 576 | } |
568 | 577 | |
569 | 578 | function compareRemoteMountsByContainerPath(a: MountInfo, b: MountInfo): number { |
|
此內容由慣性聚合(RSS閱讀器)自動聚合整理,僅供閱讀參考。 原文來自 — 版權歸原作者所有。