test(node-host): cache native binary fixture lookup · openclaw/openclaw@7436e39
steipete
·
2026-04-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -152,10 +152,16 @@ function uniqueRuntimeBinNames(
|
152 | 152 | ]; |
153 | 153 | } |
154 | 154 | |
| 155 | +let cachedNativeBinaryFixturePath: string | undefined; |
| 156 | + |
155 | 157 | function resolveNativeBinaryFixturePath(): string { |
| 158 | +if (cachedNativeBinaryFixturePath) { |
| 159 | +return cachedNativeBinaryFixturePath; |
| 160 | +} |
156 | 161 | for (const candidate of ["/bin/ls", "/usr/bin/ls", "/bin/echo", "/usr/bin/printf"]) { |
157 | 162 | try { |
158 | 163 | if (fs.statSync(candidate).isFile()) { |
| 164 | +cachedNativeBinaryFixturePath = candidate; |
159 | 165 | return candidate; |
160 | 166 | } |
161 | 167 | } catch { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。