This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/node-llama-cpp/dist/cli/utils/isRunningUnderRosetta.js
T

20 lines
782 B
JavaScript

import path from "path";
import { fileURLToPath } from "url";
import process from "process";
import { getPlatform } from "../../bindings/utils/getPlatform.js";
import { spawnCommand } from "../../utils/spawnCommand.js";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export async function isRunningUnderRosetta() {
const platform = getPlatform();
// // only check for rosetta on macOS when x64 is detected
if (platform !== "mac" || process.arch !== "x64")
return false;
try {
const res = await spawnCommand("sysctl", ["-n", "sysctl.proc_translated"], __dirname, process.env, false);
return res.combinedStd.trim() === "1";
}
catch (err) {
return false;
}
}
//# sourceMappingURL=isRunningUnderRosetta.js.map