INNER CODE UNIT · JavaScript

lookupBinary

chadbyte/clay · lib/yoke/index.js:132

  function lookupBinary(name) {
    try {
      if (process.platform === "win32") {
        return execFileSync("where", [name], { timeout: 3000, encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim().split(/\r?\n/)[0] || null;
      }
      return execFileSync("which", [name], { timeout: 3000, encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim().split(/\r?\n/)[0] || null;
    } catch (e) {
      return null;
    }
  }

  function parseClaudeAuthStatusJson(out) {
    if (!out) return null;
    try {
      return JSON.parse(out);
    } catch (e) {
      return null;
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…