mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:00:42 +00:00
test(node-host): cache native binary fixture lookup
This commit is contained in:
@@ -152,10 +152,16 @@ function uniqueRuntimeBinNames(
|
||||
];
|
||||
}
|
||||
|
||||
let cachedNativeBinaryFixturePath: string | undefined;
|
||||
|
||||
function resolveNativeBinaryFixturePath(): string {
|
||||
if (cachedNativeBinaryFixturePath) {
|
||||
return cachedNativeBinaryFixturePath;
|
||||
}
|
||||
for (const candidate of ["/bin/ls", "/usr/bin/ls", "/bin/echo", "/usr/bin/printf"]) {
|
||||
try {
|
||||
if (fs.statSync(candidate).isFile()) {
|
||||
cachedNativeBinaryFixturePath = candidate;
|
||||
return candidate;
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user