INNER CODE UNIT · JavaScript

checkAuth

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

function checkAuth() {
  if (_authCache) return _authCache;

  var execSync = require("child_process").execSync;
  var execFileSync = require("child_process").execFileSync;

  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) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…