fix(release): reject validation flag values · openclaw/openclaw@bda05db
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -44,7 +44,7 @@ function runStatus(command, args, options = {}) {
|
44 | 44 | |
45 | 45 | function readOptionValue(argv, index, optionName) { |
46 | 46 | const value = argv[index + 1]; |
47 | | -if (value === undefined || value === "" || value.startsWith("--")) { |
| 47 | +if (value === undefined || value === "" || value.startsWith("-")) { |
48 | 48 | throw new Error(`${optionName} requires a value`); |
49 | 49 | } |
50 | 50 | return value; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,7 +30,10 @@ describe("full-release-validation-at-sha", () => {
|
30 | 30 | |
31 | 31 | it("rejects missing option values", () => { |
32 | 32 | expect(() => parseArgs(["--sha", "--dry-run"])).toThrow("--sha requires a value"); |
| 33 | +expect(() => parseArgs(["--sha", "-h"])).toThrow("--sha requires a value"); |
33 | 34 | expect(() => parseArgs(["--branch"])).toThrow("--branch requires a value"); |
| 35 | +expect(() => parseArgs(["--branch", "-h"])).toThrow("--branch requires a value"); |
34 | 36 | expect(() => parseArgs(["-f", "--dry-run"])).toThrow("-f requires a value"); |
| 37 | +expect(() => parseArgs(["-f", "-h"])).toThrow("-f requires a value"); |
35 | 38 | }); |
36 | 39 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。