MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / resolveBinary

Function resolveBinary

scripts/build-harmony-har.js:354–371  ·  view source on GitHub ↗
(name, candidates)

Source from the content-addressed store, hash-verified

352}
353
354function resolveBinary(name, candidates) {
355 const explicitPath = findExistingPath(candidates);
356 if (explicitPath) {
357 return explicitPath;
358 }
359
360 const whichResult = spawnSync('bash', ['-lc', `command -v ${name}`], {
361 encoding: 'utf8',
362 });
363 if (whichResult.status === 0) {
364 const resolved = whichResult.stdout.trim();
365 if (resolved) {
366 return resolved;
367 }
368 }
369
370 return null;
371}
372
373function findExistingPath(candidates) {
374 for (const candidate of candidates) {

Callers 1

buildHarFunction · 0.85

Calls 1

findExistingPathFunction · 0.85

Tested by

no test coverage detected