chore: release 2026.1.11-3

This commit is contained in:
Peter Steinberger
2026-01-12 10:35:50 +00:00
parent 42b43f8c58
commit 5a29ec78ca
9 changed files with 50 additions and 18 deletions

View File

@@ -21,5 +21,12 @@ if (parsed.profile) {
process.argv = parsed.argv;
}
const { runCli } = await import("./cli/run-main.js");
await runCli(process.argv);
import("./cli/run-main.js")
.then(({ runCli }) => runCli(process.argv))
.catch((error) => {
console.error(
"[clawdbot] Failed to start CLI:",
error instanceof Error ? error.stack ?? error.message : error,
);
process.exitCode = 1;
});

View File

@@ -1,5 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import { createRequire } from "node:module";
const formatCommit = (value?: string | null) => {
if (!value) return null;
@@ -37,6 +38,19 @@ const resolveGitHead = (startDir: string) => {
let cachedCommit: string | null | undefined;
const readCommitFromPackageJson = () => {
try {
const require = createRequire(import.meta.url);
const pkg = require("../package.json") as {
gitHead?: string;
githead?: string;
};
return formatCommit(pkg.gitHead ?? pkg.githead ?? null);
} catch {
return null;
}
};
export const resolveCommitHash = (
options: { cwd?: string; env?: NodeJS.ProcessEnv } = {},
) => {
@@ -48,6 +62,11 @@ export const resolveCommitHash = (
cachedCommit = normalized;
return cachedCommit;
}
const pkgCommit = readCommitFromPackageJson();
if (pkgCommit) {
cachedCommit = pkgCommit;
return cachedCommit;
}
try {
const headPath = resolveGitHead(options.cwd ?? process.cwd());
if (!headPath) {