mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-05 14:21:38 +00:00
fix(cli): preserve bootstrap for version-pinned skill commands (#114924)
This commit is contained in:
committed by
GitHub
parent
61bd5af77e
commit
929a8cf641
@@ -201,6 +201,14 @@ describe("registerPreActionHooks", () => {
|
||||
.action(() => {});
|
||||
programLocal.command("completion").action(() => {});
|
||||
programLocal.command("secrets").action(() => {});
|
||||
const skills = programLocal.command("skills");
|
||||
for (const skillCommand of ["install", "verify"]) {
|
||||
skills
|
||||
.command(skillCommand)
|
||||
.argument("<skill-ref>")
|
||||
.option("--version <version>")
|
||||
.action(() => {});
|
||||
}
|
||||
programLocal
|
||||
.command("qa")
|
||||
.command("suite")
|
||||
@@ -655,6 +663,51 @@ describe("registerPreActionHooks", () => {
|
||||
expect(ensureConfigReadyMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: "version-pinned skill install",
|
||||
action: "install",
|
||||
argv: ["node", "openclaw", "skills", "install", "@owner/weather", "--version", "1.2.3"],
|
||||
},
|
||||
{
|
||||
name: "version-pinned skill verification",
|
||||
action: "verify",
|
||||
argv: ["node", "openclaw", "skills", "verify", "@owner/weather", "--version", "1.2.3"],
|
||||
},
|
||||
{
|
||||
name: "equals-form version-pinned skill install",
|
||||
action: "install",
|
||||
argv: ["node", "openclaw", "skills", "install", "@owner/weather", "--version=1.2.3"],
|
||||
},
|
||||
{
|
||||
name: "profiled version-pinned skill verification",
|
||||
action: "verify",
|
||||
argv: [
|
||||
"node",
|
||||
"openclaw",
|
||||
"--profile",
|
||||
"work",
|
||||
"skills",
|
||||
"verify",
|
||||
"@owner/weather",
|
||||
"--version",
|
||||
"1.2.3",
|
||||
],
|
||||
},
|
||||
])("runs the execution bootstrap for $name", async ({ action, argv }) => {
|
||||
await runPreAction({
|
||||
parseArgv: ["skills", action],
|
||||
processArgv: argv,
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
runtime: runtimeMock,
|
||||
commandPath: ["skills", action],
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("applies --json stdout suppression only for explicit JSON output commands", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["status"],
|
||||
|
||||
Reference in New Issue
Block a user