mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-23 08:38:08 +00:00
fix(docs): reject sync publish flag values
This commit is contained in:
@@ -172,7 +172,7 @@ const GENERATED_LOCALES = [
|
||||
|
||||
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;
|
||||
|
||||
@@ -41,6 +41,7 @@ describe("docs-sync-publish", () => {
|
||||
expect(() => parseArgs([flag, "--target", "generated-docs"])).toThrow(
|
||||
`${flag} requires a value`,
|
||||
);
|
||||
expect(() => parseArgs([flag, "-h"])).toThrow(`${flag} requires a value`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user