mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
20 lines
565 B
TypeScript
20 lines
565 B
TypeScript
// Lane Runner script supports OpenClaw repository automation.
|
|
import { warn } from "./host-command.ts";
|
|
|
|
export type SmokeLane = "fresh" | "upgrade";
|
|
export type SmokeLaneStatus = "pass" | "fail";
|
|
|
|
export async function runSmokeLane(
|
|
name: SmokeLane,
|
|
fn: () => Promise<void>,
|
|
setStatus: (name: SmokeLane, status: SmokeLaneStatus) => void,
|
|
): Promise<void> {
|
|
try {
|
|
await fn();
|
|
setStatus(name, "pass");
|
|
} catch (error) {
|
|
setStatus(name, "fail");
|
|
warn(`${name} lane failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
}
|
|
}
|