mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-24 10:58:37 +00:00
fix(release): reject validation flag values
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user