mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
fix(release): reject validation flag values
This commit is contained in:
parent
7069d95720
commit
bda05dbc2f
2 changed files with 4 additions and 1 deletions
|
|
@ -44,7 +44,7 @@ function runStatus(command, args, options = {}) {
|
|||
|
||||
function readOptionValue(argv, index, optionName) {
|
||||
const value = argv[index + 1];
|
||||
if (value === undefined || value === "" || value.startsWith("--")) {
|
||||
if (value === undefined || value === "" || value.startsWith("-")) {
|
||||
throw new Error(`${optionName} requires a value`);
|
||||
}
|
||||
return value;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,10 @@ describe("full-release-validation-at-sha", () => {
|
|||
|
||||
it("rejects missing option values", () => {
|
||||
expect(() => parseArgs(["--sha", "--dry-run"])).toThrow("--sha requires a value");
|
||||
expect(() => parseArgs(["--sha", "-h"])).toThrow("--sha requires a value");
|
||||
expect(() => parseArgs(["--branch"])).toThrow("--branch requires a value");
|
||||
expect(() => parseArgs(["--branch", "-h"])).toThrow("--branch requires a value");
|
||||
expect(() => parseArgs(["-f", "--dry-run"])).toThrow("-f requires a value");
|
||||
expect(() => parseArgs(["-f", "-h"])).toThrow("-f requires a value");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue