mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 07:31:36 +00:00
CLI: add clawdbot update command and --update flag
This commit is contained in:
committed by
Peter Steinberger
parent
9f9098406c
commit
777fb6b7bb
@@ -8,6 +8,7 @@ import { ensureClawdbotCliOnPath } from "../infra/path-env.js";
|
||||
import { assertSupportedRuntime } from "../infra/runtime-guard.js";
|
||||
import { installUnhandledRejectionHandler } from "../infra/unhandled-rejections.js";
|
||||
import { enableConsoleCapture } from "../logging.js";
|
||||
import { updateCommand } from "./update-cli.js";
|
||||
|
||||
export async function runCli(argv: string[] = process.argv) {
|
||||
loadDotEnv({ quiet: true });
|
||||
@@ -20,6 +21,12 @@ export async function runCli(argv: string[] = process.argv) {
|
||||
// Enforce the minimum supported runtime before doing any work.
|
||||
assertSupportedRuntime();
|
||||
|
||||
// Handle --update flag before full program parsing
|
||||
if (argv.includes("--update")) {
|
||||
await updateCommand({});
|
||||
return;
|
||||
}
|
||||
|
||||
const { buildProgram } = await import("./program.js");
|
||||
const program = buildProgram();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user