mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-25 00:42:24 +00:00
fix: harden update channel switching
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Command } from "commander";
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
@@ -449,6 +450,24 @@ describe("update-cli", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("parses update status --json as the subcommand option", async () => {
|
||||
const program = new Command();
|
||||
program.name("openclaw");
|
||||
program.enablePositionalOptions();
|
||||
let seenJson = false;
|
||||
const update = program.command("update").option("--json", "", false);
|
||||
update
|
||||
.command("status")
|
||||
.option("--json", "", false)
|
||||
.action((opts) => {
|
||||
seenJson = Boolean(opts.json);
|
||||
});
|
||||
|
||||
await program.parseAsync(["node", "openclaw", "update", "status", "--json"]);
|
||||
|
||||
expect(seenJson).toBe(true);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: "defaults to dev channel for git installs when unset",
|
||||
|
||||
Reference in New Issue
Block a user