fix(release): validate package tarball check args · openclaw/openclaw@71a75b9
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -76,6 +76,32 @@ function withTarball(
|
76 | 76 | } |
77 | 77 | |
78 | 78 | describe("check-openclaw-package-tarball", () => { |
| 79 | +it("prints help before touching tarball state", () => { |
| 80 | +const result = spawnSync("node", [CHECK_SCRIPT, "--help"], { encoding: "utf8" }); |
| 81 | + |
| 82 | +expect(result.status, result.stderr).toBe(0); |
| 83 | +expect(result.stdout).toContain( |
| 84 | +"Usage: node scripts/check-openclaw-package-tarball.mjs <openclaw.tgz>", |
| 85 | +); |
| 86 | +expect(result.stderr).toBe(""); |
| 87 | +}); |
| 88 | + |
| 89 | +it("rejects option-like and extra arguments before tar inspection", () => { |
| 90 | +const unknown = spawnSync("node", [CHECK_SCRIPT, "--tag"], { encoding: "utf8" }); |
| 91 | + |
| 92 | +expect(unknown.status).not.toBe(0); |
| 93 | +expect(unknown.stderr).toContain("Unknown OpenClaw package tarball check option: --tag"); |
| 94 | +expect(unknown.stderr).not.toContain("OpenClaw package tarball does not exist"); |
| 95 | + |
| 96 | +const extra = spawnSync("node", [CHECK_SCRIPT, "openclaw.tgz", "extra"], { |
| 97 | +encoding: "utf8", |
| 98 | +}); |
| 99 | + |
| 100 | +expect(extra.status).not.toBe(0); |
| 101 | +expect(extra.stderr).toContain("Unexpected OpenClaw package tarball check argument: extra"); |
| 102 | +expect(extra.stderr).not.toContain("OpenClaw package tarball does not exist"); |
| 103 | +}); |
| 104 | + |
79 | 105 | it.runIf(process.platform !== "win32")( |
80 | 106 | "removes the extract dir when tar extraction fails", |
81 | 107 | () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。