INNER CODE UNIT · JavaScript
resolveCodexBinary
chadbyte/clay · lib/yoke/index.js:208
function resolveCodexBinary() {
var fs = require("fs");
var findCodexPath = require("./codex-app-server").findCodexPath;
try {
var codexBin = findCodexPath();
if (codexBin && fs.existsSync(codexBin)) return codexBin;
} catch (e) {}
return lookupBinary("codex");
}
function checkCodex() {
try {
var codexBin = resolveCodexBinary();
if (!codexBin) return false;
execFileSync(codexBin, ["login", "status"], { timeout: 5000, encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] });
return true;