INNER CODE UNIT · JavaScript

resolveBinary

reactnativecn/react-native-update · scripts/build-harmony-har.js:402

function resolveBinary(name, candidates) {
  const explicitPath = findExistingPath(candidates);
  if (explicitPath) {
    return explicitPath;
  }

  const whichResult = spawnSync('bash', ['-lc', `command -v ${name}`], {
    encoding: 'utf8',
  });
  if (whichResult.status === 0) {
    const resolved = whichResult.stdout.trim();
    if (resolved) {
      return resolved;
    }
  }

  return null;
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…