openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
31 lines (30 loc) • 1.3 kB
JavaScript
import { d as isRootVersionInvocation } from "./argv-BGeGfpwR.mjs";
import { r as resolveCliContainerTarget } from "./container-target-71yNSyL1.mjs";
//#region src/entry.version-fast-path.ts
function tryHandleRootVersionFastPath(argv) {
if (resolveCliContainerTarget(argv)) return false;
if (!isRootVersionInvocation(argv)) return false;
const onError = async (error) => {
const message = `[openclaw] Failed to resolve version: ${error instanceof Error ? error.stack ?? error.message : String(error)}\n`;
try {
const [{ loadCliDotEnv }, { formatConsoleDiagnosticBlock }] = await Promise.all([import("./dotenv-DpAMwI7j.mjs"), import("./json-console-line-COTb7cDP.mjs")]);
loadCliDotEnv({ quiet: true });
process.stderr.write(formatConsoleDiagnosticBlock({
level: "error",
message
}));
} catch {
process.stderr.write(message);
} finally {
process.exit(1);
}
};
Promise.all([import("./version-kgZfZIwI.mjs"), import("./git-commit-2Umss1hd.mjs")]).then(([{ VERSION }, { resolveCommitHash }]) => {
const commit = resolveCommitHash({ moduleUrl: import.meta.url });
console.log(commit ? `OpenClaw ${VERSION} (${commit})` : `OpenClaw ${VERSION}`);
process.exit(0);
}).catch(onError);
return true;
}
//#endregion
export { tryHandleRootVersionFastPath as t };